activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bwtaylor <bryan_w_tay...@yahoo.com>
Subject AMQ-1191 for 5.3 broke master/slave locking for Oracle
Date Fri, 24 Jul 2009 16:54:06 GMT

We just tried to port our broker to a 5.3 snapshot and got an exception at
broker startup:

DefaultDatabaseLocker          - Failed to acquire lock:
java.sql.SQLException: statement handle not executed: getMetaData
java.sql.SQLException: statement handle not executed: getMetaData

We use Oracle for our persistence store, and it turns out that the Oracle
JDBC driver will throw an error if getMetaData is called before statement
execution. I dug into this to find which patch changed this, and found this:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java?r1=747391&r2=787990&diff_format=h

This shows that revision 787990 added an if() predicated taat calls
statement.getMetaData(), which throws the error since
statement.executeQuery() has not yet been called. If you have Oracle
Metalink, see bug 3917619, which was closed "Not a Bug." (asserting this
behavior is allowed under the JDBC spec) and also see bug 3934162, which
will change this behavior in the 11.2 jdbc driver (not out yet) as an
enhancement request. The normal work around to this problem is to append an
impossible where clause like "where 1=0" and go ahead and execute the query.

Interestingly, the ticket seeks to make master/slave locking work with
SqlServer, and the specific change has a comment about needing to make it
work with derby. We are using Derby in our dev environments and Oracle in
our current production environment, and we are considering SqlServer in some
future production environments. So we'd like 5.3 to work with all of these
RDBMS's :-).

Hope this helps...
-- 
View this message in context: http://www.nabble.com/AMQ-1191-for-5.3-broke-master-slave-locking-for-Oracle-tp24648059p24648059.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Mime
View raw message