revathi balakrishnan

Greenhorn
+ Follow
since Mar 22, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by revathi balakrishnan

Hi all,
Finally we have fould out the rootcause for transaction rollback....it was the global transaction timeout.in websphere the default global transaction timeout is 120 seconds...if your transaction exceeds this period then it will throw the rollback exception and will rollback the global transaction.We found out this from the warning message printed in the websphere logs.
hi ,

We have the below code in our jsp

<fmt : formatNumber MaxFraction Digits="1" MinFraction Digits="1" value=$variable >

if the variable value is 6.650996 it prints 6.7
if the variable value is 6.652273 it prints 6.7
if the variable value is 6.65 it prints 6.6

we actually expect 6.65 also to be printed us 6.7,since the second decimal digit is 5
It would be very helpful if you could explain us the logic of fmt in converting decimal numbers...
13 years ago
JSP
Hi Amit,
My apologies for the erroneous code above.
Initially My observation of the issue was also wrong , it is actually RollbackException and not SystemException
i have pasted my exact code and problem below .



Problem : In Websphere ,I am trying to update 2 remote databases using a global transaction.
In the two remote database operations,one is to update the DB2 database and the other is to update the SQL server,
First it will establish the connection in DB 2 server, it compiles the stored procedure but does not commit, then it completes the sql server updation, if the sql server updation is successful it commits initially the compiled stored procedure operation.

while doing this I am getting a RollbackException on userTran.commit()

0000001a SystemErr javax.transaction.RollbackException
at com.ibm.ws.Transaction.JTA.TransactionImpl.stage3C ommitProcessing(TransactionImpl.java:1737)
at com.ibm.ws.Transaction.JTA.TransactionImpl.process Commit(TransactionImpl.java:1506)
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit( TransactionImpl.java:1428)
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit( TranManagerImpl.java:236)
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(T ranManagerSet.java:157)
at com.ibm.ws.Transaction.JTA.UserTransactionImpl.com mit(UserTransactionImpl.java:285


Could you please help me know the possibilities for getting a Rollback Exception.



i learnt that, if the transaction is marked for rollback-only, then while committing that transaction this kind of issue will occur.but i verified my code and i do not find any such explicit call to rollback. Is there any way to identify the rootcause of it . i am very new to java, please provide me the debugging tips to identify the rootcause of this issue


Code below

userTransaction getUserTransaction() // method to get the userTran object from JNDI lookup
{
UserTransaction userTran=null;

try{
InitialContext = new InitialContext();
UserTran = (UserTransaction)initCtx.lookup("java/comp/UserTransaction");
}catch(NamingException e)
{
//code to handle exception

}
return userTran;

}

void beginTransaction( UserTransaction userTran ) //method to to begin the global transaction
{
try{

userTran.begin();

} catch ()
{
//code to handle exception

}

}

void commitTransaction() //method to to commit the global transaction
{

try{

userTran.commit();//TransactionRollException occurs here [/color]

} catch ()
{
//code to handle exception

}

}


void transactionRollback() //method to rollback the global transaction
{

try{

userTran.rollback();

} catch ()
{
//code to handle exception

}

}



boolean isSqlSuccess ; //boolean to verify the sql transaction success status

UserTransaction userTran = getUserTransaction();

beginTransaction(userTran ); //global transaction begins here

try
{

updateJdbcTransaction(); // Initially perform DB2 stored procedure operations , but do not commit
isSqlSuccess =updateSqlServerTransaction(); // after that perform sql server operation on a remote server and commit it

}
Catch(Exception e)
{
//This part handles the Application exceptions
}
finally {
if(isSqlSuccess ) //if the sql server updation is succuessful,commit the pre compiled jdbc operation
commitTransaction(userTran); //Rollbackexception occurs inside this method.
else
transactionRollback(userTran);//if the sql server updation is unsuccuessful,rollback the pre compiled jdbc operation


}



Is there any way to identify the rootcause of it . i am very new to java , please provide me the debugging tips to identify the rootcause of this issue
Actual problem occurs in production and everyday our customers are getting affected beacuse of this issue .
i request your valuable suggestions friends
Hi All,
In Websphere ,I am trying to update 2 remote databases using a global transaction.

in the two remote database operations,one is to update the DB2 database and the other is to update the sql server,
First it will establish the connection in DB 2 server, it compiles the stored procedure but does not commit, then it completes the sql server updation, if the sql server updation is successful it commits initially the compiled stored procedure operation.

UserTransaction UT= new getUserTransaction();
try(
UT.begin() //global transaction begin

performDB2SPcompilation();//perform DB2 stored procedure operations , but do not commit
Issqlsuccess=perform sql server operations(); //perform sql server updation, and it will be commited



}
catch (Exception e)
{
e.PrintStackTrace();
}
finally
(
(Issqlsuccess)//if the sql server operation is successful
UT.commit() //commit the DB2 operation

}

while doing this I am getting a system exception on UT.commit() , followed by RollbackException is thrown

0000001a SystemErr javax.transaction.RollbackException
at com.ibm.ws.Transaction.JTA.TransactionImpl.stage3C ommitProcessing(TransactionImpl.java:1737)
at com.ibm.ws.Transaction.JTA.TransactionImpl.process Commit(TransactionImpl.java:1506)
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit( TransactionImpl.java:1428)
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit( TranManagerImpl.java:236)
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(T ranManagerSet.java:157)
at com.ibm.ws.Transaction.JTA.UserTransactionImpl.com mit(UserTransactionImpl.java:285)
.


Is there anyway identify the rootcause for systemexception,or please let us know if there is a way handle this ,any help is appreciated,
Please provide me your valuable suggestions on this.Everyday at least one customer is getting affected by this issue....we have seen 25 affected cases now


thanks to every one who attempt to help me