Skip to Content.
Sympa Menu

freetds - jdbc 2.0 driver + sqlserver 7.0 + begin + commit transaction

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ismo.tuononen AT solenovo.fi
  • To: freetds AT franklin.oit.unc.edu
  • Subject: jdbc 2.0 driver + sqlserver 7.0 + begin + commit transaction
  • Date: Mon, 4 Jun 2001 05:40:06 -0400


Hi,

I am using jdbc 2.0 driver with sqlserver 7.0 and when I execute
next commands:

Connection cx = Common.getConnection();
Statement stmt = cx.createStatement();

cx.setAutoCommit(false);
stmt.executeUpdate("begin transaction");
stmt.executeUpdate("set lock_timeout 0");
Statement stmt2 = cx.createStatement();
stmt2.executeUpdate("commit transaction");

I get exception:

Exception in thread "main" java.sql.SQLException: The COMMIT TRANSACTION
request has no corresponding BEGIN TRANSACTION.
at
com.internetcds.jdbc.tds.SqlMessage.toSQLException(SqlMessage.java:85)
at
com.internetcds.jdbc.tds.SQLWarningChain.addOrReturn(SQLWarningChain.java:56)

at
com.internetcds.jdbc.tds.Statement.getMoreResults(Statement.java, Compiled
Code)
at com.internetcds.jdbc.tds.Statement.execute(Statement.java,
Compiled Code)
at
com.internetcds.jdbc.tds.Statement.executeUpdate(Statement.java, Compiled
Code)
at t1.main(t1.java:93)


if I use same statement (stmt) it works ok.
And if I use weblogic's JDBC driver it works ok.

Any ideas whats wrong?

Ismo




Archive powered by MHonArc 2.6.24.

Top of Page