can you try with MVCC enabled. http://www.h2database.com/html/advanced.html#mvcc


Thanks
Veresh

-----Original Message-----
From: Les Spivey [mailto:[email protected]] 
Sent: Tuesday, July 13, 2010 2:58 PM
To: [email protected]
Subject: RE: h2 as internal database

I tried using a recent snapshot of Ode 1.3.5 in Tomcat 5.5 using the 
instructions for H2 and Hibernate here: http://ode.apache.org/ode-schema.html.  
My ode-axis2.properties are:

ode-axis2.db.pool.min=20
ode-axis2.db.pool.max=200
ode-axis2.threads.pool.size=200
#ode-axis2.threads.pool.size=1

ode-axis2.dao.factory=org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl
ode-axis2.db.mode=INTERNAL
ode-axis2.db.int.jdbcurl=jdbc:h2:file:C:/Progra~1/Tomcat_5_5/webapps/ode/WEB-INF/h2db/ode-db;DB_CLOSE_ON_EXIT=false;user=sa
ode-axis2.db.int.driver=org.h2.Driver
hibernate.dialect=org.hibernate.dialect.H2Dialect
ode-axis2.acquireTransactionLocks=true

Using the Ode HelloWorld2 example, if I start a single thread in JMeter to 
access the service it works fine.  However, if I try multiple threads hitting 
the service (say 20) I almost immediately get the exception that follows.  This 
is similar to what I see with Derby under the same conditions.  Do either Derby 
or H2 actually work when the ode-axis2.threads.pool.size is greater than one?  


14:45:07,697 WARN  [GeronimoConnectionEventListener] connectionErrorOccurred 
called with null
org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "ODE_JOB"; SQL 
statement:
insert into ODE_JOB  (jobid, nodeid, ts, scheduled, transacted, 
instanceId,mexId,processId,type,channel,correlatorId,correlationKeyS
et,retryCount,inMem,detailsExt) values(?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,?,?) 
[50200-137]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
        at org.h2.message.DbException.get(DbException.java:167)
        at org.h2.message.DbException.get(DbException.java:144)
        at org.h2.table.RegularTable.doLock(RegularTable.java:466)
        at org.h2.table.RegularTable.lock(RegularTable.java:404)
        at org.h2.command.dml.Insert.insertRows(Insert.java:119)
        at org.h2.command.dml.Insert.update(Insert.java:82)
        at org.h2.command.CommandContainer.update(CommandContainer.java:70)
        at org.h2.command.Command.executeUpdate(Command.java:199)
        at 
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
        at 
org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
        at 
org.tranql.connector.jdbc.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:103)
        at 
org.apache.ode.scheduler.simple.JdbcDelegate.insertJob(JdbcDelegate.java:229)
        at 
org.apache.ode.scheduler.simple.SimpleScheduler.schedulePersistedJob(SimpleScheduler.java:378)
        at 
org.apache.ode.scheduler.simple.SimpleScheduler.schedulePersistedJob(SimpleScheduler.java:354)
        at 
org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.invoke(MyRoleMessageExchangeImpl.java:154)
        at 
org.apache.ode.axis2.ODEService.onAxisMessageExchange(ODEService.java:126)
        at 
org.apache.ode.axis2.hooks.ODEMessageReceiver.invokeBusinessLogic(ODEMessageReceiver.java:69)
        at 
org.apache.ode.axis2.hooks.ODEMessageReceiver.invokeBusinessLogic(ODEMessageReceiver.java:52)
        at 
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
        at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167)
        at 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
        at 
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:837)
        at 
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
        at 
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1287)
        at java.lang.Thread.run(Unknown Source)
14:45:07,806 ERROR [SimpleScheduler] Database error.
org.apache.ode.scheduler.simple.DatabaseException: 
org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "ODE_JOB"; SQL 
stateme
nt:
insert into ODE_JOB  (jobid, nodeid, ts, scheduled, transacted, 
instanceId,mexId,processId,type,channel,correlatorId,correlationKeyS
et,retryCount,inMem,detailsExt) values(?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,?,?) 
[50200-137]
        at 
org.apache.ode.scheduler.simple.JdbcDelegate.insertJob(JdbcDelegate.java:231)
        at 
org.apache.ode.scheduler.simple.SimpleScheduler.schedulePersistedJob(SimpleScheduler.java:378)
        at 
org.apache.ode.scheduler.simple.SimpleScheduler.schedulePersistedJob(SimpleScheduler.java:354)
        at 
org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.invoke(MyRoleMessageExchangeImpl.java:154)
        at 
org.apache.ode.axis2.ODEService.onAxisMessageExchange(ODEService.java:126)
        at 
org.apache.ode.axis2.hooks.ODEMessageReceiver.invokeBusinessLogic(ODEMessageReceiver.java:69)
        at 
org.apache.ode.axis2.hooks.ODEMessageReceiver.invokeBusinessLogic(ODEMessageReceiver.java:52)




-----Original Message-----
From: Rafal Rusin [mailto:[email protected]] 
Sent: Wednesday, July 07, 2010 2:12 PM
To: [email protected]
Subject: Re: h2 as internal database

In order to get rid of deadlocks in H2, you need to grab latest ODE
snapshot and add
ode.acquireTransactionLocks=true
to ode-axis2.properties.
It's needed, because H2 uses poor locking mechanism.
I tried H2 with Hibernate and it worked well.

On Wed, Jul 7, 2010 at 8:27 PM, Les Spivey <[email protected]> wrote:
> The Ode documentation here
> http://ode.apache.org/ode-jbi-and-axis2-properties-overview.html shows
> how to setup an internal database other than Derby using
> "ode-axis2.db.mode=INTERNAL".  Has anyone done this with H2?  I've tried
> and it appears to work until there is any kind of load then I get
> "org.apache.openjpa.persistence.PersistenceException: Deadlock detected"
> exceptions.  ode-axis2.threads.pool.size is set to 200.
>
>
>
> I've seen examples with H2 as an external database using Hibernate but I
> cannot use Hibernate because of the license.  Also, I'm using Jetty and
> not Tomcat.  Any suggestions?
>
>
>
> Thanks, Les.
>
>

-- 
Regards,
RafaƂ Rusin
http://rrusin.blogspot.com

Reply via email to