users@glassfish.java.net

Re: RE: defaultAutoCommit and JDBC Connection Pool

From: <glassfish_at_javadesktop.org>
Date: Fri, 23 Apr 2010 10:06:51 PDT

Ah thanks very much Martin for replying.

Interesting to hear that you cannot set autoCommit to false in the configuration.

This is my init:

    protected void init() {
        if (initDone) {
            return;
        }

        dataSource = (DataSource)ctx.getBean("dataSource");
        initDone = true;
    }

I added in there a

try {
        dataSource.getConnection().setAutoCommit(false);
} catch (java.sql.SQLException e) {}

type of thing but that didn't work. I'm showing my inexperience here - so looks like I'm not getting the connection properly, if this is the proper way to do it.

Thanks!
[Message sent by forum member 'm_jenkins']

http://forums.java.net/jive/thread.jspa?messageID=398704