Hi Rob,
Ages ago you implemented (Avaje) Bug 379 at my request. This is JdbcTransaction setting the connection auto commit to false if it's true and resetting it at the end if it was true to start with. This did the trick for me at first but I figured out it was a problem if I started a transaction in my legacy JDBC code before calling something in Ebean. I didn't determine the problem back then, I just worked off my own build of 2.8.1 where the feature was removed.
Recently we've been working on upgrading PostgreSQL to 9.3. The JDBC driver for 9.3 is complaining about the auto commit setting in a way 8.4 was not. In looking in to that problem and also working with Ebean 4 the issue has come back in to focus for me.
The way we handled transactions before Ebean (and still) in JDBC is with auto commit always true then to execute actual queries "begin", "commit", and "rollback" rather setAutoCommit(false) followed by commit() or rollback() on the Connection. With the 379 work I have a unit test that fails, something like this:
start transaction in JDBC
update something
"find" something in Ebean
commit the transaction
try to find the same thing in JDBC
value found is not the updated value
I discovered the "find" in Ebean issues a "rollback" call. What I'd like to do is intercept my JDBC executions of "begin", "commit", and "rollback" and replace them with calls to setAutoCommit(false), commit() and rollback(). But it seems even that will fail. Can you give me some insight as to why an apparently simple "select/find" query issues a rollback? What are the various Ebean actions that result in a call to commit()/rollback() when there is no change to the database?
Thanks.
/Daryl