Hello Alexander,

Thank you - this helped to understand the way of how (a-)synchronization could be done to avoid concurrency conflicts while writing LONG values to the db by the current JDBC implementation (7.6).

It is perhaps important to know that the JDBC-driver itself does also synchronize on the Connection-object for various operations, as I saw in the source code.

BTW: By trying the workaround ...

synchronized(statement.getConnection()) {
   statement.execute();
}

... we encounter deadlocks. As often, there are several possible reasons for this. We'll try to fix it.

Regards,
Gariel Matter
Invoca Systems

... But if B.executeUpdate() writes to the same table [same row of that table], this could lead to the posted problem. If so, there would perhaps be a more efficient way to synchronize so that Thread-2 can still execute Updates as long as we know that this can not cause any problem with the statement A.executeUpdate (in the example above).

The problem is that B is not able to know what is harmful currently and what's not. You can only wait until no harm can be done because you
get the 'connection lock'. The client cannot estimate what the statement
will do on the database.
Regards
Alexander Schröder


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to