My database contains clob objects. when sync with ha-jdbc I have an error :
Exception in thread "main" java.lang.IllegalStateException: java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:592)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:178)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
do you have a solution?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is my stackTrace whith server log warn level :
|2009-03-12T10:29:55.059+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=11;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=9069c16a-35df-4da8-85c8-cf1fa50b34e9;|39543 [RMI TCP Connection(8)-192.168.0.1] INFO net.sf.hajdbc.sql.AbstractDatabaseCluster - Starting synchronization of database database2 from cluster Cluster.
|#]
[#|2009-03-12T10:29:55.424+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=11;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=9069c16a-35df-4da8-85c8-cf1fa50b34e9;|39907 [RMI TCP Connection(8)-192.168.0.1] INFO net.sf.hajdbc.sync.FullSynchronizationStrategy - Deleted 2,312 rows from APP.LOG_TECHNICALS
|#]
[#|2009-03-12T10:31:42.354+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=11;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=9069c16a-35df-4da8-85c8-cf1fa50b34e9;|146838 [RMI TCP Connection(8)-192.168.0.1] WARN net.sf.hajdbc.sql.AbstractDatabaseCluster - Failed to activate database database2 from cluster cluster
|#]
[#|2009-03-12T10:31:42.363+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|ThreadID=11;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=9069c16a-35df-4da8-85c8-cf1fa50b34e9;|java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.client.am.Lob.checkValidity(Unknown Source)
at org.apache.derby.client.am.Clob.length(Unknown Source)
at org.apache.derby.client.net.NetStatementRequest.computeProtocolTypesAndLengths(Unknown Source)
at org.apache.derby.client.net.NetStatementRequest.buildSQLDTAcommandData(Unknown Source)
at org.apache.derby.client.net.NetStatementRequest.writeExecute(Unknown Source)
at org.apache.derby.client.net.NetPreparedStatement.writeExecute(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.writeExecute(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatchRequestX(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatchX(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatch(Unknown Source)
at net.sf.hajdbc.sync.FullSynchronizationStrategy.synchronize(FullSynchronizationStrategy.java:176)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:951)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:574)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:178)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.derby.client.am.SqlException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
... 45 more
|#]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This sounds like Derby requires special Clob handling that the generic synchronization strategy is not setup to do. I'll look at the Derby docs and see what I can make of their large object update/delete procedure. This will likely involve an update to the DerbyDialect - and perhaps a new Dialect method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
My database contains clob objects. when sync with ha-jdbc I have an error :
Exception in thread "main" java.lang.IllegalStateException: java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:592)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:178)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
do you have a solution?
Thanks.
Sounds like a bug in Derby. Let me see if I can locate a specific bug report and/or find a sufficient workaround.
You should find the root cause of this exception in your log using WARN or ERROR level. Can you attach this as well?
Can you also attach your client code where your clob is accessed?
Hello,
I use WARN log level :
[#|2009-03-11T10:36:40.979+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=15;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=4ff32d36-eec3-4c83-a9b9-735be2d92a12;|252082 [RMI TCP Connection(8)-192.168.0.1] WARN net.sf.hajdbc.sql.AbstractDatabaseCluster - Failed to activate database database1 from cluster Cluster1
|#]
The client code is Hibernate..
Can you update your logging configuration to show stack traces? Your log seems to only displaying the exception message, but no stacktrace (the helpful part).
http://ha-jdbc.sourceforge.net/api/src-html/net/sf/hajdbc/sql/AbstractDatabaseCluster.html#line.581
Hello,
This is my stackTrace whith server log warn level :
|2009-03-12T10:29:55.059+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=11;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=9069c16a-35df-4da8-85c8-cf1fa50b34e9;|39543 [RMI TCP Connection(8)-192.168.0.1] INFO net.sf.hajdbc.sql.AbstractDatabaseCluster - Starting synchronization of database database2 from cluster Cluster.
|#]
[#|2009-03-12T10:29:55.424+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=11;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=9069c16a-35df-4da8-85c8-cf1fa50b34e9;|39907 [RMI TCP Connection(8)-192.168.0.1] INFO net.sf.hajdbc.sync.FullSynchronizationStrategy - Deleted 2,312 rows from APP.LOG_TECHNICALS
|#]
[#|2009-03-12T10:31:42.354+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=11;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=9069c16a-35df-4da8-85c8-cf1fa50b34e9;|146838 [RMI TCP Connection(8)-192.168.0.1] WARN net.sf.hajdbc.sql.AbstractDatabaseCluster - Failed to activate database database2 from cluster cluster
|#]
[#|2009-03-12T10:31:42.363+0100|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|ThreadID=11;_ThreadName=RMI TCP Connection(8)-192.168.0.1;_RequestID=9069c16a-35df-4da8-85c8-cf1fa50b34e9;|java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.client.am.Lob.checkValidity(Unknown Source)
at org.apache.derby.client.am.Clob.length(Unknown Source)
at org.apache.derby.client.net.NetStatementRequest.computeProtocolTypesAndLengths(Unknown Source)
at org.apache.derby.client.net.NetStatementRequest.buildSQLDTAcommandData(Unknown Source)
at org.apache.derby.client.net.NetStatementRequest.writeExecute(Unknown Source)
at org.apache.derby.client.net.NetPreparedStatement.writeExecute(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.writeExecute(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatchRequestX(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatchX(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatch(Unknown Source)
at net.sf.hajdbc.sync.FullSynchronizationStrategy.synchronize(FullSynchronizationStrategy.java:176)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:951)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:574)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.activate(AbstractDatabaseCluster.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:178)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.derby.client.am.SqlException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
... 45 more
|#]
This sounds like Derby requires special Clob handling that the generic synchronization strategy is not setup to do. I'll look at the Derby docs and see what I can make of their large object update/delete procedure. This will likely involve an update to the DerbyDialect - and perhaps a new Dialect method.
Hello,
Do you have found a solution ?
The release of this patch is it planned?
Thanks.
Not yet. I'll give this another look this weekend.