|
From: Colin S. <col...@ex...> - 2003-08-26 03:44:20
|
Here's a patch for SingleConnectionDataSource which allows the setAutoCommit call to be controlled, as per earlier discussion. By default, the class will no longer call setCommit at all if an existing connection is given to it in the constructor. Otherwise it will behave the same as before by default (i.e. if the connection is obtained from DriveManager then setAutoCommit(true) is called). There are flags to control the calling of setAutoCommit and the initial state. As to whether the class should even allow overriding this when the connection comes from DriverManger; it's true that most people would expect the state to be autocommit=true as per the Connection javadocs, but on the other hand the code was simpler this way, and maybe the extra flexibility will help in testing... Regards, Colin |