EJB / EE :: Distributed Transactions On MDB

Jan 12, 2015

I have a scenario :

A ) If there is a message driven bean with CMT and transaction attribute required

-begin MDB
-Write to DB
-Send message to queue
-Null pointer exception.

I know this is a system exception , the transaction will be rolled back , which mean all my changes to DB will be rolled back.

But what will happen to the message sent to JMS queue ? It will be removed also ?

B) what will happen if the same above sequence appear with BMT

-Start transaction
-Write to DB
-Send message to queue
-Null pointer exception.

What about my changes at DB and my message at queue ?

View Replies


ADVERTISEMENT

Scope Of Public Variable And Distributed Application

Jun 2, 2014

A distributed application consists of modules which run on different machines. How is this possible? Does it have any link with the public modifier?

View Replies View Related

EJB / EE :: How To Tell Container To Rollback Transactions

Mar 20, 2009

My requirement is to rollback a Transaction which acts with (REQUIRED) Transaction Attribute .

How can i tell the container to rollback a transaction when using with CMT in EJB3.0 ...

View Replies View Related

Bank Account - Printing Out Transactions

Apr 21, 2014

public class BankAccount
{
String name;
int accountID;
double balance;
}
public void setAcct ( String nam, double acctID)

[Code] ....

1. Create a class called BankAccount
a. It will be a generic simple type of BankAccount

2. BankAccount will contain variables to store:
a. the owner/owners of the account
b. an account id
c. it may contain other basic information (up to you)

3. BankAccount will contain methods that will allow you to:
a. Set the account owners information
b. Deposit money
c. Withdraw money
d. Set balances
e. Print out transactions (think more like an atm each time an action is taken it gets printed)

4. BankAccount will contain its own main()
a. At least 2 BankAccount objects will be created and ALL of their methods called .

What to do for the print out transactions

View Replies View Related

EJB / EE :: Design Patterns - Usage Of Transactions And Exceptions

Feb 3, 2015

When it comes to Java EE I see many developers having trouble with the usage of transactions and exceptions and when to use what.

I see a full chapter of RESTful Web Services, but do you also relate these Web Services to their counterparts (SOAP Web Services)?

View Replies View Related

Adding And Subtracting In Budget Program - Display Table Showing Transactions

Mar 15, 2014

Budget program. Here is my situation, I have 2 tabs in a GUI, one tab adds a transactions when the add button is clicked, and in the other tab displays a table showing all the transactions. In my code, I want it so that when the user chooses a deposit(combo box variable name = cbType, indexnumber for deposit is 0) it will add to the total and when the user chooses withdraw(index number is 1) then it will subtract it from the total. Here is the code.... (note as well, the code also adds a new row to the table)

//add button clicked
private class BtnAddActionListener implements ActionListener {
public void actionPerformed(ActionEvent arg0) {
((DefaultTableModel)table.getModel()).addRow(new Object[]{
cbMonth.getSelectedItem() + "/" + txtDay.getText() + "/" + cbYear.getSelectedItem(),
cbCategory.getSelectedItem(),

[Code] .....

So when I tested the program with 2 transactions, the first transaction was a deposit and the 2nd transaction was a withdraw. The end product was that both amounts were subtracted from the total. When I did a withdraw first and a deposit second, the amounts were both added together.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved