Re: Datadirect JDBC driver on DB2: Locks not released

From: Charles Fineman (cfineman-no&spam_at_yahoo.com)
Date: 03/23/04


Date: Tue, 23 Mar 2004 10:08:34 -0500

Are you getting this connection from a managed pool or are you getting
it directly from the driver?

If you are getting it from a pool (i.e. a data source managed by your
app server) then it might be disallowing you from turning auto-commit on
(since it messes with the JTA transaction semantic). All of the
implementations I've encountered silently ignore the setting of
auto-commit (something I invariably test since it's often a source of
errors for developers). I would rather the spec force them to throw an
exception in such cases :-(

Matthew wrote:
> I am involved in a project that is porting a large database
> application from SQL server to DB2 and have run into some difficulty
> with DataDirect's level 3 JDBC driver for DB2 (running under linux).
>
> I have a number of CallableStatements created at the beginning of a
> process, used multiple times during the process and then closed at the
> end (all are created on the same connection - but are used by only one
> thread - i.e. no two statements are executed simultaneously).
>
> One of these statements inserts values into a table and another reads
> from it. The problem is that the statement that inserts acquires a
> lock on the table that isn't released until the statement is CLOSED
> (even though Autocommit is ON). This means that the select statement
> is locked out.
>
> If autocommit is turned off and the connection is commited after the
> insert statement then the locks are released - isn't it true that
> setting autocommit to true should make the connection behave exactly
> as if autocommit was off, but the connection was commited after every
> statement? Is this a bug?
>
> Any help will be appreciated as changing our approach (i.e. manually
> committing) has quite wide impact on the system and is going to cost
> us a lot of development time.
>
> Thanks,
>
> Matthew
> Software Developer
> Mosaic Software
> Cape Town



Relevant Pages

  • Datadirect JDBC driver on DB2: Locks not released
    ... with DataDirect's level 3 JDBC driver for DB2. ... If autocommit is turned off and the connection is commited after the ... committing) has quite wide impact on the system and is going to cost ...
    (comp.lang.java.databases)
  • Re: Datadirect JDBC driver on DB2: Locks not released
    ... StarQuest has some DB2 connectivity solutions ... and a specific DB2 to SQL Server ... > (even though Autocommit is ON). ... > If autocommit is turned off and the connection is commited after the ...
    (comp.lang.java.databases)
  • XAPool 1.3.2 releases
    ... ChangeLog: ... restored autocommit after transaction ... added log.debug message into closemethod (StandardXAConnectionHandle) ... XAPool is an XA database connection pool: ...
    (comp.lang.java.databases)
  • Re: Commit
    ... > commit is without effect. ... Or when the pool shuts down and closes ... > to false on the connection, ... if autoCommit is set to false and no commit has been ...
    (comp.lang.java.databases)
  • Call to DirectoryEntry.Invoke("SetPassword", new object[] {password} ) failing
    ... After creating a new user and committing, I am attempting to set the ... If I connect to a local server ... I am using the default connection ... DirectoryEntry adUserFolder = new DirectoryEntry(strADServerUrl, ...
    (microsoft.public.windows.server.active_directory)