Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Set autocommit to false but still commits

843859Dec 11 2008 — edited Nov 20 2014
Hi, i'm working on a webservice with GlassFish v2 and Oracle 10g as database. When I get a connection from the connection pool I set it autocommit to false after that I execute a preparedstatement and i don't commit and i don't rollback (because i have to wait for more PreparedStatements). The problem is that the transaction actually commits. Does any one know what could be the problem?

This is the code when a i get the connection:
Context initCtx = null;
Connection conn;

// Connection conn;
try
{
initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)initCtx.lookup("jdbc/personalizador");
conn = ds.getConnection(); 
conn.setAutoCommit(false);
}

catch (Exception e)
{
throw new JDBCException();
}
Thanks. Ramiro.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2009
Added on Dec 11 2008
10 comments
1,741 views