Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Help Required

  Asked By: Raynard    Date: Nov 29    Category: Java    Views: 584
  

In a transaction maintained by transaction manager(Bea
Weblogic), i have opened a new connection and set the
connection.setautocommit(false). after insertion of
the row in the database i have not either committed or
rolled back the transaction but have called the
statement.close() and connection.close. what will be
the state of database table after the connection is
closed and transaction is committed by transaction
manager.

code snap


Statement statement = null;
System.out.println(query);
try {
connection = ((DataSource) (new
InitialContext()).lookup(
"DataSource")).getConnection();
connection.setAutoCommit(false);
statement = connection.createStatement();
statement.execute(query);

} catch (Exception ex) {
ex.printStackTrace();
} finally {
try {
statement.close();
connection.close();
} catch (Exception exx) {
exx.printStackTrace();
}
}

Actually i am getting
XAER_PROTO : Routine was invoked in an inproper
context start() failed on resource 'DataSource':
error which is believe is caused by something related
to this snap.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Help Required Or get search suggestion and latest updates.




Tagged: