From: Fred T. <fr...@us...> - 2011-02-16 22:36:00
|
As I have run some multithreaded Hibernate JPA tests without any problem. How do you get the connections? Which connection pool are you using? Does the problem occur soon after the start of tests or after a while. Also please try with ;hsqldb.tx=mvcc added to the URL to see if this makes a difference. Fred On Wed, 16 Feb 2011 13:14 -0800, "Murali Krishnan" <cm...@ya...> wrote: Fred, Sorry I still see the same issue - i just grabbed the hsqldb jar from here ([1]http://hsqldb.org/support/hsqldb_16.zip) and ran my test and it still hangs when doing a select query. It appears to be the same problem, but you can probably tell better from the stacktrace below: Murali --- thread dump --- "TestScheduler_Worker-2" prio=6 tid=0x03b7d400 nid=0x108c waiting on condition [0x0538e000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x105cd108> (a java.util.concurrent.CountDownLatch$Sync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndChec kInterrupt(AbstractQueuedSynchronizer.java:811) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSh aredInterruptibly(AbstractQueuedSynchronizer.java:969) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShar edInterruptibly(AbstractQueuedSynchronizer.java:1281) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207 ) at org.hsqldb.lib.CountUpDownLatch.await(CountUpDownLatch.java:58) at org.hsqldb.Session.executeCompiledStatement(Session.java:1297) at org.hsqldb.Session.execute(Session.java:974) - locked <0x105ccfe8> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(JDBCPreparedSta tement.java:4637) at org.hsqldb.jdbc.JDBCPreparedStatement.executeQuery(JDBCPreparedSt atement.java:283) - locked <0x105dc380> (a org.hsqldb.jdbc.JDBCPreparedStatement) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.j ava:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1953) at org.hibernate.loader.Loader.doQuery(Loader.java:802) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollection s(Loader.java:274) at org.hibernate.loader.Loader.loadEntity(Loader.java:2037) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEnt ityLoader.java:86) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEnt ityLoader.java:76) at org.hibernate.persister.entity.AbstractEntityPersister.load(Abstr actEntityPersister.java:3293) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasour ce(DefaultLoadEventListener.java:496) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLo adEventListener.java:477) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoad EventListener.java:227) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(Defa ultLoadEventListener.java:285) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLo adEventListener.java:152) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityMa nagerImpl.java:614) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityMa nagerImpl.java:589) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI mpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA ccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEnti tyManagerInvocationHandler.invoke(SharedEntityManagerCreator.java :240) at $Proxy95.find(Unknown Source) ____________________________________________________________ From: Fred Toussi <fr...@us...> To: User discussions about HyperSQL Database Engine. <hsq...@li...> Sent: Wed, February 16, 2011 2:50:26 PM Subject: Re: [Hsqldb-user] Threads in waiting state An issue similar to this was recently fixed. Please use the latest snapshot jar (released today) from the [2]http://hsqldb.org/support/ and report if there is still an issue. Fred On Wed, 16 Feb 2011 03:19 -0800, "Murali Krishnan" <cm...@ya...> wrote: Hi, I am using hibernate 3.6.1.Final (core and entity-manager) and hsqldb 2.0.0 (also tried latest 2.0.1 rc3). I'm seeing that my unit test that uses multiple threads is stalling and doing a thread dump shows that they are in WAITING state as shown below. Any ideas why? Even with just 2 threads I see that both of them are in this state with the same stacktrace. Thanks Murali ------- thread dump snippet -------------- "TestScheduler_Worker-2" prio=6 tid=0x03f5f400 nid=0x1780 waiting on condition [0x0535e000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x10558198> (a java.util.concurrent.CountDownLatch$Sync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndChec kInterrupt(AbstractQueuedSynchronizer.java:811) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSh aredInterruptibly(AbstractQueuedSynchronizer.java:969) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShar edInterruptibly(AbstractQueuedSynchronizer.java:1281) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207 ) at org.hsqldb.lib.CountUpDownLatch.await(CountUpDownLatch.java:51) at org.hsqldb.Session.executeCompiledStatement(Session.java:1275) at org.hsqldb.Session.execute(Session.java:956) - locked <0x10558078> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(JDBCPreparedSta tement.java:4609) at org.hsqldb.jdbc.JDBCPreparedStatement.executeQuery(JDBCPreparedSt atement.java:282) - locked <0x10566d00> (a org.hsqldb.jdbc.JDBCPreparedStatement) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.j ava:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1953) at org.hibernate.loader.Loader.doQuery(Loader.java:802) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollection s(Loader.java:274) at org.hibernate.loader.Loader.loadEntity(Loader.java:2037) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEnt ityLoader.java:86) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEnt ityLoader.java:76) at org.hibernate.persister.entity.AbstractEntityPersister.load(Abstr actEntityPersister.java:3293) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasour ce(DefaultLoadEventListener.java:496) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLo adEventListener.java:477) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoad EventListener.java:227) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(Defa ultLoadEventListener.java:285) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLo adEventListener.java:152) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityMa nagerImpl.java:614) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityMa nagerImpl.java:589) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) -------------------------------------------------------------------------- ---- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. [3]http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Hsqldb-user mailing list Hsq...@li... [4]https://lists.sourceforge.net/lists/listinfo/hsqldb-user -------------------------------------------------------------------------- ---- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Hsqldb-user mailing list Hsq...@li... https://lists.sourceforge.net/lists/listinfo/hsqldb-user References 1. http://hsqldb.org/support/hsqldb_16.zip 2. http://hsqldb.org/support/ 3. http://p.sf.net/sfu/intel-dev2devfeb 4. https://lists.sourceforge.net/lists/listinfo/hsqldb-user |