Thomas Gagné wrote:
> In Sybase, if I want multiple statements to be part of a transaction I
> can nestle them between BEGIN TRAN/COMMIT TRAN statements. reading
> about JDBC's Connection objects I understand how auto commit works. But
> I'm confused about the absense of a beginTran(). I suppose if
> AutoCommit(false) then there's an assumed BEGIN at the start of my
> statements that remains opened until I send either commit() or rollback()?
The JDBC driver should handle the DBMS-side details of beginning and
ending transactions, transparently to you. Basically, yes, if you
setAutoCommit(false) on your connection, then you should expect a new
transaction to be started when the first statement is executed on that
connection after opening the connection or committing or rolling back a
transaction. The same transaction will remain open, as far as JDBC is
concerned, until you either commit() or rollback(), and all statements
executed on that connection will be part of it. If the DBMS and JDBC
run into a conflict with respect to transaction boundaries then you
should expect to receive an SQLException. If you want multiple
concurrent transactions you must have multiple connections.
John Bollinger