JDBC warning on setAutoCommit(false)
От | Dustin Sallings |
---|---|
Тема | JDBC warning on setAutoCommit(false) |
Дата | |
Msg-id | Pine.OSX.4.50.0212222359410.586-100000@dhcp-196.west.spy.net обсуждение исходный текст |
Ответы |
Re: JDBC warning on setAutoCommit(false)
|
Список | pgsql-jdbc |
I've got some code that abstracts JDBC connections and does all kinds of magic for me. One of things it does is, when returning a connection to the pool, it looks for any SQLWarnings the connection contains. I've got a few things that begin transactions by setting autocommit to false, then do some work, then commit (or rollback), and then set autocommit back to true. When the connection is returned to the DB, the following warning is issued: java.sql.SQLWarning: WARNING: COMMIT: no transaction in progress at org.postgresql.jdbc1.AbstractJdbc1Connection.addWarning(AbstractJdbc1Connection.java:430) at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:111) at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:482) at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:461) at org.postgresql.jdbc1.AbstractJdbc1Connection.setAutoCommit(AbstractJdbc1Connection.java:942) [...my code...] This doesn't seem like the right thing to do...I should be able to enable autocommit without a warning when a transaction is not in progress. If anything, I should get a warning is there *is* a transaction in progress. -- SPY My girlfriend asked me which one I like better. pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net> | Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE L_______________________ I hope the answer won't upset her. ____________
В списке pgsql-jdbc по дате отправления: