Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JDBC "COMMIT TRANSACTION" returning prematurely

1 view
Skip to first unread message

and...@spengler-netz.de

unread,
Sep 29, 2006, 11:38:08 AM9/29/06
to
Hi,

we are developing a JDBC based SOA application with a Sybase ASE server
as DB. jConnect is version 5.5.

In the following code snippet

Statement stmt = this.getDbConnection().createStatement();
stmt.execute("BEGIN TRANSACTION US");

DO_SOMETHING();

stmt.execute("COMMIT TRANSACTION US");

ResultSet trancount = stmt.executeQuery("SELECT @@TRANCOUNT");
if (trancount.next())
ourLogger.debug("Number of open transactions: " +
trancount.getInt(1));
trancount.close();
stmt.close();

the JDBC driver always returns before physically committing the
transaction to the DB, i.e. I get a

Number of open transactions: 1

in my logs, although the JDBC driver already returned from the "COMMIT
TRANSACTION US" query. The commit itself takes some more time to
actually complete...

Is there a way to change this behaviour? I would rather have the JDBC
driver block the stmt.execute() call until the transaction is really
done in the DB.

Rgds,

Andreas

0 new messages