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