My usual process for learning something is a quick prototype. For setting up a
driver pool with autocommit = false, I implemented the little quickie prototype
below.
Properties dbProp = new Properties();
dbProp.put("user", "aUser");
dbProp.put("password", "aPw");
dbProp.put("loginTimeout", "35");
dbProp.put("binaryBatchInsert", "true");
dbProp.put("autocommit", false);
DataSource dataSource = setupDataSource("myConnectURI", dbProp); //this the
standard example on the website
Connection conn = dataSource.getConnection();
System.out.println("autocommit: " + conn.getAutoCommit()); //this prints out
false
Next.
I moved the above code verbatim to my actual server code.
The first connection I get from the pool has autocommit == false. I return
this connection back to the pool.
But the second time I get a connection from the pool it has autocommit == true.
I have no idea why autocommit is set to a different state for the second
connection? I can do a test and then set to autocommit = false, but I would
like to understand the inconsistency.
Thanks.
Steve Pruitt
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]