You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Les Spivey <Le...@Attachmate.com> on 2010/07/07 20:27:38 UTC

h2 as internal database

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.


Re: h2 as internal database

Posted by Waruna Ranasinghe <wa...@gmail.com>.
I have used H2 as DB in ODE experimental branch (2.0) with OpenJPA.
I did replace the default Derby by H2, for that I patched
the il-common/src/main/java/org/apache/ode/il/dbutil/Database.java

I also used ";MVCC=TRUE" parameter as well.


Thanks,
Waruna

On 14 July 2010 21:55, Les Spivey <Le...@attachmate.com> wrote:

> I tried MVCC=TRUE and, if anything, it was worse.  JMeter output is
> attached.  After 15 or 20 successful executions the console fills with the
> exceptions below.  I also should note that I am logging events -
> <process-events generate="all"/>.  However, this does work using MySQL as an
> external database instead of Derby or H2, but a pure Java database would be
> desirable.
>
> Thanks for your continued suggestions.
>
>
> -----Original Message-----
> From: Rafal Rusin [mailto:rafal@intalio.com]
> Sent: Wednesday, July 14, 2010 2:58 AM
> To: user@ode.apache.org
> Subject: Re: h2 as internal database
>
> On Tue, Jul 13, 2010 at 11:58 PM, Les Spivey <Le...@attachmate.com>
> wrote:
> > 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?
>
> This is good question :-)
> Currently it doesn't.
> But as Veresh said, this could be improved I guess. In theory H2
> supports MVCC by MVCC=TRUE. In practice, it's untested.
> So I guess you can try to comment out acquireTransactionLocks and set
> MVCC=TRUE. Then please provide your output from JMeter.
>
> >
> >
> > 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:rafal@intalio.com]
> > Sent: Wednesday, July 07, 2010 2:12 PM
> > To: user@ode.apache.org
> > 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 <Le...@attachmate.com>
> 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
>
> --
> Regards,
> Rafał Rusin
> http://rrusin.blogspot.com
>



-- 
-----------------------------------------------------
Regards,
Waruna Ranasinghe

mob: 0724318285
blog: http://warunapw.blogspot.com
twitter: http://twitter.com/warunapww
http://lk.linkedin.com/in/waruna
www.facebook.com/waruna.ranasinghe

RE: h2 as internal database

Posted by Les Spivey <Le...@Attachmate.com>.
I tried MVCC=TRUE and, if anything, it was worse.  JMeter output is attached.  After 15 or 20 successful executions the console fills with the exceptions below.  I also should note that I am logging events - <process-events generate="all"/>.  However, this does work using MySQL as an external database instead of Derby or H2, but a pure Java database would be desirable.

Thanks for your continued suggestions.


-----Original Message-----
From: Rafal Rusin [mailto:rafal@intalio.com] 
Sent: Wednesday, July 14, 2010 2:58 AM
To: user@ode.apache.org
Subject: Re: h2 as internal database

On Tue, Jul 13, 2010 at 11:58 PM, Les Spivey <Le...@attachmate.com> wrote:
> 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?

This is good question :-)
Currently it doesn't.
But as Veresh said, this could be improved I guess. In theory H2
supports MVCC by MVCC=TRUE. In practice, it's untested.
So I guess you can try to comment out acquireTransactionLocks and set
MVCC=TRUE. Then please provide your output from JMeter.

>
>
> 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:rafal@intalio.com]
> Sent: Wednesday, July 07, 2010 2:12 PM
> To: user@ode.apache.org
> 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 <Le...@attachmate.com> 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

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

Re: h2 as internal database

Posted by Rafal Rusin <ra...@intalio.com>.
On Tue, Jul 13, 2010 at 11:58 PM, Les Spivey <Le...@attachmate.com> wrote:
> 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?

This is good question :-)
Currently it doesn't.
But as Veresh said, this could be improved I guess. In theory H2
supports MVCC by MVCC=TRUE. In practice, it's untested.
So I guess you can try to comment out acquireTransactionLocks and set
MVCC=TRUE. Then please provide your output from JMeter.

>
>
> 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:rafal@intalio.com]
> Sent: Wednesday, July 07, 2010 2:12 PM
> To: user@ode.apache.org
> 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 <Le...@attachmate.com> 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

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

RE: h2 as internal database

Posted by Les Spivey <Le...@Attachmate.com>.
Thanks for the reply but I tried changing the property as you suggested and it made no difference.  I searched through the source code and the only reference to anything that included acquireTransactionLocks as a property is in ode-trunk\axis2-war\src\test\webapp\WEB-INF\conf.hib-derby\ode-axis2.properties.  I don't know if that's even valid.



-----Original Message-----
From: Milinda Pathirage [mailto:milinda.pathirage@gmail.com] 
Sent: Tuesday, July 13, 2010 11:24 PM
To: user@ode.apache.org; veresh@intalio.com
Subject: Re: h2 as internal database

I think the following property is wrong

ode-axis2.acquireTransactionLocks=true

it should be

ode-axis2.ode.acquireTransactionLocks=true

Thanks
Milinda

On Wed, Jul 14, 2010 at 6:00 AM, Veresh Jain <ve...@intalio.com> wrote:

> can you try with MVCC enabled.
> http://www.h2database.com/html/advanced.html#mvcc
>
>
> Thanks
> Veresh
>
> -----Original Message-----
> From: Les Spivey [mailto:Les.Spivey@Attachmate.com]
> Sent: Tuesday, July 13, 2010 2:58 PM
> To: user@ode.apache.org
> 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:rafal@intalio.com]
> Sent: Wednesday, July 07, 2010 2:12 PM
> To: user@ode.apache.org
> 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 <Le...@attachmate.com>
> 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
>
>


-- 
Milinda Pathirage
Technical Lead & Product Manager WSO2 BPS; http://wso2.org/bps
WSO2 Inc.; http://wso2.com
E-mail: milinda@wso2.com, milinda.pathirage@gmail.com
Web: http://mpathirage.com
Blog: http://blog.mpathirage.com

Re: h2 as internal database

Posted by Milinda Pathirage <mi...@gmail.com>.
I think the following property is wrong

ode-axis2.acquireTransactionLocks=true

it should be

ode-axis2.ode.acquireTransactionLocks=true

Thanks
Milinda

On Wed, Jul 14, 2010 at 6:00 AM, Veresh Jain <ve...@intalio.com> wrote:

> can you try with MVCC enabled.
> http://www.h2database.com/html/advanced.html#mvcc
>
>
> Thanks
> Veresh
>
> -----Original Message-----
> From: Les Spivey [mailto:Les.Spivey@Attachmate.com]
> Sent: Tuesday, July 13, 2010 2:58 PM
> To: user@ode.apache.org
> 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:rafal@intalio.com]
> Sent: Wednesday, July 07, 2010 2:12 PM
> To: user@ode.apache.org
> 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 <Le...@attachmate.com>
> 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
>
>


-- 
Milinda Pathirage
Technical Lead & Product Manager WSO2 BPS; http://wso2.org/bps
WSO2 Inc.; http://wso2.com
E-mail: milinda@wso2.com, milinda.pathirage@gmail.com
Web: http://mpathirage.com
Blog: http://blog.mpathirage.com

RE: h2 as internal database

Posted by Veresh Jain <ve...@intalio.com>.
can you try with MVCC enabled. http://www.h2database.com/html/advanced.html#mvcc


Thanks
Veresh

-----Original Message-----
From: Les Spivey [mailto:Les.Spivey@Attachmate.com] 
Sent: Tuesday, July 13, 2010 2:58 PM
To: user@ode.apache.org
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:rafal@intalio.com] 
Sent: Wednesday, July 07, 2010 2:12 PM
To: user@ode.apache.org
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 <Le...@attachmate.com> 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


RE: h2 as internal database

Posted by Les Spivey <Le...@Attachmate.com>.
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:rafal@intalio.com] 
Sent: Wednesday, July 07, 2010 2:12 PM
To: user@ode.apache.org
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 <Le...@attachmate.com> 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

Re: h2 as internal database

Posted by Rafal Rusin <ra...@intalio.com>.
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 <Le...@attachmate.com> 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