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.