You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by Toto Toto <pi...@gmail.com> on 2007/11/23 19:03:08 UTC

Ode.war; persistency with MySQL using BEA Weblogic Server

Hi everyone,

As per documentation, ODE is running with an embedded db (Derby),
through OpenJPA framework. My aim is to plug a MySQL database - for
the time being, as the targeted candidate would likely be Oracle or
SQL Server (anyway, the goal is identical).

I read the ODE doumentation, had a look to the OpenJPA one, and I must
admit I did not find any guide demonstrating how to unplug Derby in
favor of MySQL. I've quote some questions below. Don't hesitate to
re-route me to some documentation if I missed it.

Thanks in advance.

========== Ecosystem
 + BEA Weblogic 10, Java 5.0
 + ODE 1.1 (downloaded the war)
 + MySQL 5.0.45

========== Is persistency mandatory?
First, I would like to understand if ODE requires or not a DB /
persistency mechanism.

"ODE Execution Events" paragraph of the User Guide
(http://ode.apache.org/user-guide.html) says that events are
persisted. However, it also says that it is possible to completely
deactivate them.

"ODE Data Access Objects" paragraph of the Architectural Overview page
(http://ode.apache.org/achitectural-overview.html) says that "the BPEL
Engine Runtime requires DAO objects to deal with the following
persistence issues:
* active instances – keeping track of which instances have been created
* message routing – which instance is waiting for which message
* variables – the values of the BPEL variables for each instance
* partner links – the values of the BPEL partner links for each instance
* process execution state – the serialized state of the Jacob
"persistent virtual machine"
But is this also valid for short running processes? Indeed, I do not
plan to create at all long running processes that would require to
persist states...

Finally, "Additional Settings" paragraph of
http://ode.apache.org/creating-a-process.html page says that "[one]
can define a process as being executed only in-memory. This greatly
reduces the amount of generated queries and puts far less load on your
database."

Still, it is not 100% clear to me either ODE requires persistency or
not. I would say so, but...
By the way, what is the minimal scope of data to be persisted?
Is http://svn.apache.org/viewvc/ode/trunk/dao-hibernate-db/src/main/sql/simplesched-mysql.sql?view=markup
the only schema to create in MySQL?


========== Overriding persistency settings
First, I would like to understand, in case of ode.war, at which layer
the persistency settings have to be overriden:
 - ODE layer: I did not find any conf file directly related to ODE
persistency config...
 - OpenJPA: I found some persistence.xml files packaged into some
jars, but I do not think that's the right place.
 - axis level, through ode-axis2.properties.

Even if I am a bit puzzled - it sounds strange to me that Axis drives
ODE db settings... - I would say the latter case apply. Is this the
appropriate solution?

Indeed, from this link:
http://groups.google.com/group/tempo-dev/browse_thread/thread/03175939ca3e395a/046b3e91222fe83d?#046b3e91222fe83d
I understood that a ode-axis2.properties file had to be set in
ode.war/WEB-INF/conf folder in order to override the database
settings. Here is how mine looks like:

ode-axis2.db.mode=EXTERNAL
ode-axis2.db.ext.dataSource=java:mysql/jdbc/odePool/OdePool
ode-axis2.tx.factory.class=org.apache.ode.axis2.util.JBossFactory
ode-axis2.message.replicate.emptyns=true
ode-axis2.dao.factory=org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl

Obvisouly, this configuration produces exceptions:

weblogic.application.ModuleException: [HTTP:101216]Servlet:
"AxisServlet" failed to preload on startup in Web application: "ode".
java.lang.reflect.InvocationTargetException
 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:585)
 at org.apache.ode.axis2.ODEServer.initTxMgr(ODEServer.java:381)
 at org.apache.ode.axis2.ODEServer.init(ODEServer.java:141)
 at org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:47)
 at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:282)
 at ....
Caused by: java.lang.RuntimeException: Error while looking up
TransactionManager at java:/TransactionManager
 at org.apache.ode.axis2.util.JBossFactory.getTransactionManager(JBossFactory.java:44)
 ... 47 more
Caused by: javax.naming.NameNotFoundException: While trying to look up
/TransactionManager in /app/webapp/ode/20490977.; remaining name
'/TransactionManager'
 at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1138)
 ...

As it could have been expected, both JBossFactory and GeronimoFactory
failed to be instanciated in the context of a Weblogic server.
Therefore I'll have to implement one.
Except this development, is the configuration ok?

Indeed, just after this exception, I have another one, related to
OpenJPA itself:
<4|true|0.9.7> org.apache.openjpa.persistence.ArgumentException: A
JDBC Driver or DataSource class name must be specified in the
ConnectionDriverName property.
 at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:67)
 at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:797)
 at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:563)

It sounds to be related to
http://openjpa.apache.org/docs/latest/manual/dbsupport_mysql.html
If I well understood, these parameters have to be defined in an
openjpa.xml configuration file, that should be deployed in
ode.war/META-INF

Am I right?

========
Sorry for this long email. Any help would be greatly appreciated ;o)

Regards.

Re: Ode.war; persistency with MySQL using BEA Weblogic Server

Posted by Alex Boisvert <bo...@intalio.com>.
Hi again Vincent,

Could you open a Jira issue and attach your WLSFactory code there?

http://issues.apache.org/jira/browse/ODE

I'm asking because there's a little checkbox in Jira where you agree to
license your code to the ASF and it provides a clean IP trail for the
code....

TIA,
alex


On 11/30/07, Vincent <pi...@gmail.com> wrote:
>
> Hi Alex,
>
> Thanks for the answer. As you'll notice, I changed my "nickname" for
> my first name - this email is just
> another-email-that-can-be-spammed-as-I-do-not-care-about ;o)
>
> I just wanted to share my experiment on the mailing list - it may be
> useful one day for someone.
>
> I remind the context: BEA Weblogic Server 10.0 (WLS), Java 5, MySQL 5.
> What I did was to demonstrate the feasibility and assess the
> performances. So that's maybe not 100% clean.
>
> ========
> 1- Create a TransactionManager factory.
> As previously said, it is similar to the JBossFactory
> (
> http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/util/JBossFactory.java
> )
>
> I attached this factory to this email, see WLSFactory.java.
> Then add it somehow (either in an additional jar, or by updating ode's
> war) to the WLS classpath.
>
> ========
> 2-  Create the schema and tables in MySQL
> + Download and install a MySQL server
> + Create a schema called 'ode' and a user/pwd with appropriate
> credentials (grant select, insert, delete and update).
>
> + Add to the ode schema the tables listed at
>
> http://mail-archives.apache.org/mod_mbox/ode-user/200706.mbox/raw/%3cfbdc6a970706120754y62339783nf4accb5d758a4053@mail.gmail.com%3e/2
> .
> To generate this schema, a rake build is mandatory, refer to the
> mailing list:
> http://mail-archives.apache.org/mod_mbox/ode-user/200706.mbox/%3cfbdc6a970706120754y62339783nf4accb5d758a4053@mail.gmail.com%3e
>
> + Then the tables listed in ODE src at:
>
> http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/dao-hibernate-db/src/main/sql/\simplesched-mysql.sql
> .
>
> I sumed-up in an ode.sql file all the tables and indexes to create. I
> attached it to this email.
>
> ========
> 3- Create the 'ode-axis2.properties' file
> Add a ode-axis2.properties configuration file in ode.war/WEB-INF/conf
> Assuming that the datasource jndi name is 'mysql.jdbc.odePool.OdePool'
> and that the TransactionManager factory is
> org.apache.ode.axis2.util.WLSFactory:
>
> ode-axis2.db.mode=EXTERNAL
> # the datasource JNDI name:
> ode-axis2.db.ext.dataSource=mysql.jdbc.odePool.OdePool
> # the WLS TransactionManager factory:
> ode-axis2.tx.factory.class=org.apache.ode.axis2.util.WLSFactory
> # pay attention, the following class moved from
> 'org.apache.ode.daohib.bpel' pkg to 'org.apache.ode.dao.jpa' :
> ode-axis2.dao.factory=org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl
> # not sure it has smth to see with persistency, but I found it in an
> example, so:
> ode-axis2.message.replicate.emptyns=true
>
> ========
> 4-  Create a datasource in WLS
> + Download and add the MySQL JDBC driver to the WLS classpath.
> + Start WLS and create a datasource (I defined the JNDI name as
> mysql.jdbc.odePool.OdePool).
>
> ========
> 5- Start WLS
> And redeploy the BPEL processes, it should work.
>
> ========
> Just few highlights about performances. I tried to figure out the
> impact of the <in-memory> setting on the persistency management.
> The following figures give a pretty good overview - but obviously they
> deserve a more detailed study.
>
> I attach it to this email, see figures.txt.
>
> Regards,
>
> Vincent
>
>

Re: Ode.war; persistency with MySQL using BEA Weblogic Server

Posted by Alex Boisvert <bo...@intalio.com>.
Hi Vincent,

Following your tests, Matthieu made some changes/optimizations in the
OpenJPA persistence to avoid some table scans.  So you should see
performance improvements in your test when using the latest 1.1-branch code.

Depending on your requirements, you may also consider tweaking event
generation (
http://ode.apache.org/user-guide.html#UserGuide-ODEExecutionEvents) to
reduce the amount of data written to the database.

alex


On 12/3/07, Vincent <pi...@gmail.com> wrote:
>
> Re Alex, Matthieu,
>
> 1) Thanks for having made me remind I forgot to specify the hardware I
> used ;o)
> I am working on a PC workstation - Pentium IV 2.8 Ghz - 2 GB RAM -
> Seagate Barracuda 7200rpm / 8.5ms - Win XP SP2 Pro.
> While running the tests, only WLS and MySQL were running, plus 2 or 3
> other softwares such as MySQL monitor or Windows Explorer.
> So I do think that neither the hardware not the software can be blamed
> for the results.
>
> 2) Except the changes I listed in my previous email, I did not modify
> anything to the ODE persistency mechanism. So I do think that OpenJPA
> was used.
> I attached to this email a zip file (mysql_queries.zip) containing the
> db traces collected while deploying and running the BPEL process,
> either in "in-memory" mode or "persisting" one.
> You'll notice that the request as well as the answer are persisted,
> but also a lot of events (I think that's what Matthieu was "looking
> for") / serialized java objects.
> NB: I can not publicly disclose the BPEL process that was used, sorry.
>
> ===============
>
> As requested, I opened a JIRA issue to post the WLSFactory, see
> http://issues.apache.org/jira/browse/ODE-216.
>
> Regards,
>
> Vincent
>
>

Re: Ode.war; persistency with MySQL using BEA Weblogic Server

Posted by Vincent <pi...@gmail.com>.
Re Alex, Matthieu,

1) Thanks for having made me remind I forgot to specify the hardware I used ;o)
I am working on a PC workstation - Pentium IV 2.8 Ghz - 2 GB RAM -
Seagate Barracuda 7200rpm / 8.5ms - Win XP SP2 Pro.
While running the tests, only WLS and MySQL were running, plus 2 or 3
other softwares such as MySQL monitor or Windows Explorer.
So I do think that neither the hardware not the software can be blamed
for the results.

2) Except the changes I listed in my previous email, I did not modify
anything to the ODE persistency mechanism. So I do think that OpenJPA
was used.
I attached to this email a zip file (mysql_queries.zip) containing the
db traces collected while deploying and running the BPEL process,
either in "in-memory" mode or "persisting" one.
You'll notice that the request as well as the answer are persisted,
but also a lot of events (I think that's what Matthieu was "looking
for") / serialized java objects.
NB: I can not publicly disclose the BPEL process that was used, sorry.

===============

As requested, I opened a JIRA issue to post the WLSFactory, see
http://issues.apache.org/jira/browse/ODE-216.

Regards,

Vincent

Re: Ode.war; persistency with MySQL using BEA Weblogic Server

Posted by Matthieu Riou <ma...@offthelip.org>.
I was also thinking of the events. It would only affect writes and not reads
but ODE generate massive quantities of events by default. Deactivating those
would probably bring the numbers for persistent processes to something more
reasonable. And btw he's using the OpenJPA persistence layer, on which we
should do more tuning.

Cheers,
Matthieu

On Nov 30, 2007 7:31 AM, Alex Boisvert <bo...@intalio.com> wrote:

> Hi Vincent,
>
> Thanks for sharing!
>
> A couple of observations,
>
> 1) The performance with persistence (in-memory=false) seems low, I would
> generally expect something in the range of 30-60 txn/s.   It may be
> related
> to MySQL tuning, slow disks (are you running on a laptop?), or maybe point
> number 2 below.
>
> 2) The number of reads while executing persistent processes seems awfully
> high (15005 reads).  I can't explain this off the top of my head.   Maybe
> we've overlooked something in the persistence code.   Are you using JPA or
> Hibernate persistence?   (JPA is the default)
>
> 3) It's interesting to note that persistent processes are more than twice
> as
> CPU intensive as in-memory ones (590 sec. vs 247 sec).   The O/R mapping
> layer ain't cheap!  :)
>
> 4) Looks like we're doing a pretty good job on in-memory processes: 346
> txn/s!   But this begs a question on the type of hardware you used to run
> the benchmark....
>
> alex
>
>
> On 11/30/07, Vincent <pi...@gmail.com> wrote:
> >
> > Hi Alex,
> >
> > Thanks for the answer. As you'll notice, I changed my "nickname" for
> > my first name - this email is just
> > another-email-that-can-be-spammed-as-I-do-not-care-about ;o)
> >
> > I just wanted to share my experiment on the mailing list - it may be
> > useful one day for someone.
> >
> > I remind the context: BEA Weblogic Server 10.0 (WLS), Java 5, MySQL 5.
> > What I did was to demonstrate the feasibility and assess the
> > performances. So that's maybe not 100% clean.
> >
> > ========
> > 1- Create a TransactionManager factory.
> > As previously said, it is similar to the JBossFactory
> > (
> >
> http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/util/JBossFactory.java
> > )
> >
> > I attached this factory to this email, see WLSFactory.java.
> > Then add it somehow (either in an additional jar, or by updating ode's
> > war) to the WLS classpath.
> >
> > ========
> > 2-  Create the schema and tables in MySQL
> > + Download and install a MySQL server
> > + Create a schema called 'ode' and a user/pwd with appropriate
> > credentials (grant select, insert, delete and update).
> >
> > + Add to the ode schema the tables listed at
> >
> >
> http://mail-archives.apache.org/mod_mbox/ode-user/200706.mbox/raw/%3cfbdc6a970706120754y62339783nf4accb5d758a4053@mail.gmail.com%3e/2
> > .
> > To generate this schema, a rake build is mandatory, refer to the
> > mailing list:
> >
> http://mail-archives.apache.org/mod_mbox/ode-user/200706.mbox/%3cfbdc6a970706120754y62339783nf4accb5d758a4053@mail.gmail.com%3e
> >
> > + Then the tables listed in ODE src at:
> >
> >
> http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/dao-hibernate-db/src/main/sql/\simplesched-mysql.sql<http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/dao-hibernate-db/src/main/sql/%5Csimplesched-mysql.sql>
> > .
> >
> > I sumed-up in an ode.sql file all the tables and indexes to create. I
> > attached it to this email.
> >
> > ========
> > 3- Create the 'ode-axis2.properties' file
> > Add a ode-axis2.properties configuration file in ode.war/WEB-INF/conf
> > Assuming that the datasource jndi name is 'mysql.jdbc.odePool.OdePool'
> > and that the TransactionManager factory is
> > org.apache.ode.axis2.util.WLSFactory:
> >
> > ode-axis2.db.mode=EXTERNAL
> > # the datasource JNDI name:
> > ode-axis2.db.ext.dataSource=mysql.jdbc.odePool.OdePool
> > # the WLS TransactionManager factory:
> > ode-axis2.tx.factory.class=org.apache.ode.axis2.util.WLSFactory
> > # pay attention, the following class moved from
> > 'org.apache.ode.daohib.bpel' pkg to 'org.apache.ode.dao.jpa' :
> >
> ode-axis2.dao.factory=org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl
> > # not sure it has smth to see with persistency, but I found it in an
> > example, so:
> > ode-axis2.message.replicate.emptyns=true
> >
> > ========
> > 4-  Create a datasource in WLS
> > + Download and add the MySQL JDBC driver to the WLS classpath.
> > + Start WLS and create a datasource (I defined the JNDI name as
> > mysql.jdbc.odePool.OdePool).
> >
> > ========
> > 5- Start WLS
> > And redeploy the BPEL processes, it should work.
> >
> > ========
> > Just few highlights about performances. I tried to figure out the
> > impact of the <in-memory> setting on the persistency management.
> > The following figures give a pretty good overview - but obviously they
> > deserve a more detailed study.
> >
> > I attach it to this email, see figures.txt.
> >
> > Regards,
> >
> > Vincent
> >
> >
>

Re: Ode.war; persistency with MySQL using BEA Weblogic Server

Posted by Alex Boisvert <bo...@intalio.com>.
Hi Vincent,

Thanks for sharing!

A couple of observations,

1) The performance with persistence (in-memory=false) seems low, I would
generally expect something in the range of 30-60 txn/s.   It may be related
to MySQL tuning, slow disks (are you running on a laptop?), or maybe point
number 2 below.

2) The number of reads while executing persistent processes seems awfully
high (15005 reads).  I can't explain this off the top of my head.   Maybe
we've overlooked something in the persistence code.   Are you using JPA or
Hibernate persistence?   (JPA is the default)

3) It's interesting to note that persistent processes are more than twice as
CPU intensive as in-memory ones (590 sec. vs 247 sec).   The O/R mapping
layer ain't cheap!  :)

4) Looks like we're doing a pretty good job on in-memory processes: 346
txn/s!   But this begs a question on the type of hardware you used to run
the benchmark....

alex


On 11/30/07, Vincent <pi...@gmail.com> wrote:
>
> Hi Alex,
>
> Thanks for the answer. As you'll notice, I changed my "nickname" for
> my first name - this email is just
> another-email-that-can-be-spammed-as-I-do-not-care-about ;o)
>
> I just wanted to share my experiment on the mailing list - it may be
> useful one day for someone.
>
> I remind the context: BEA Weblogic Server 10.0 (WLS), Java 5, MySQL 5.
> What I did was to demonstrate the feasibility and assess the
> performances. So that's maybe not 100% clean.
>
> ========
> 1- Create a TransactionManager factory.
> As previously said, it is similar to the JBossFactory
> (
> http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/util/JBossFactory.java
> )
>
> I attached this factory to this email, see WLSFactory.java.
> Then add it somehow (either in an additional jar, or by updating ode's
> war) to the WLS classpath.
>
> ========
> 2-  Create the schema and tables in MySQL
> + Download and install a MySQL server
> + Create a schema called 'ode' and a user/pwd with appropriate
> credentials (grant select, insert, delete and update).
>
> + Add to the ode schema the tables listed at
>
> http://mail-archives.apache.org/mod_mbox/ode-user/200706.mbox/raw/%3cfbdc6a970706120754y62339783nf4accb5d758a4053@mail.gmail.com%3e/2
> .
> To generate this schema, a rake build is mandatory, refer to the
> mailing list:
> http://mail-archives.apache.org/mod_mbox/ode-user/200706.mbox/%3cfbdc6a970706120754y62339783nf4accb5d758a4053@mail.gmail.com%3e
>
> + Then the tables listed in ODE src at:
>
> http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/dao-hibernate-db/src/main/sql/\simplesched-mysql.sql
> .
>
> I sumed-up in an ode.sql file all the tables and indexes to create. I
> attached it to this email.
>
> ========
> 3- Create the 'ode-axis2.properties' file
> Add a ode-axis2.properties configuration file in ode.war/WEB-INF/conf
> Assuming that the datasource jndi name is 'mysql.jdbc.odePool.OdePool'
> and that the TransactionManager factory is
> org.apache.ode.axis2.util.WLSFactory:
>
> ode-axis2.db.mode=EXTERNAL
> # the datasource JNDI name:
> ode-axis2.db.ext.dataSource=mysql.jdbc.odePool.OdePool
> # the WLS TransactionManager factory:
> ode-axis2.tx.factory.class=org.apache.ode.axis2.util.WLSFactory
> # pay attention, the following class moved from
> 'org.apache.ode.daohib.bpel' pkg to 'org.apache.ode.dao.jpa' :
> ode-axis2.dao.factory=org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl
> # not sure it has smth to see with persistency, but I found it in an
> example, so:
> ode-axis2.message.replicate.emptyns=true
>
> ========
> 4-  Create a datasource in WLS
> + Download and add the MySQL JDBC driver to the WLS classpath.
> + Start WLS and create a datasource (I defined the JNDI name as
> mysql.jdbc.odePool.OdePool).
>
> ========
> 5- Start WLS
> And redeploy the BPEL processes, it should work.
>
> ========
> Just few highlights about performances. I tried to figure out the
> impact of the <in-memory> setting on the persistency management.
> The following figures give a pretty good overview - but obviously they
> deserve a more detailed study.
>
> I attach it to this email, see figures.txt.
>
> Regards,
>
> Vincent
>
>

Re: Ode.war; persistency with MySQL using BEA Weblogic Server

Posted by Vincent <pi...@gmail.com>.
Hi Alex,

Thanks for the answer. As you'll notice, I changed my "nickname" for
my first name - this email is just
another-email-that-can-be-spammed-as-I-do-not-care-about ;o)

I just wanted to share my experiment on the mailing list - it may be
useful one day for someone.

I remind the context: BEA Weblogic Server 10.0 (WLS), Java 5, MySQL 5.
What I did was to demonstrate the feasibility and assess the
performances. So that's maybe not 100% clean.

========
1- Create a TransactionManager factory.
As previously said, it is similar to the JBossFactory
(http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/util/JBossFactory.java)

I attached this factory to this email, see WLSFactory.java.
Then add it somehow (either in an additional jar, or by updating ode's
war) to the WLS classpath.

========
2-  Create the schema and tables in MySQL
+ Download and install a MySQL server
+ Create a schema called 'ode' and a user/pwd with appropriate
credentials (grant select, insert, delete and update).

+ Add to the ode schema the tables listed at
http://mail-archives.apache.org/mod_mbox/ode-user/200706.mbox/raw/%3cfbdc6a970706120754y62339783nf4accb5d758a4053@mail.gmail.com%3e/2.
To generate this schema, a rake build is mandatory, refer to the
mailing list: http://mail-archives.apache.org/mod_mbox/ode-user/200706.mbox/%3cfbdc6a970706120754y62339783nf4accb5d758a4053@mail.gmail.com%3e

+ Then the tables listed in ODE src at:
http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/dao-hibernate-db/src/main/sql/\simplesched-mysql.sql.

I sumed-up in an ode.sql file all the tables and indexes to create. I
attached it to this email.

========
3- Create the 'ode-axis2.properties' file
Add a ode-axis2.properties configuration file in ode.war/WEB-INF/conf
Assuming that the datasource jndi name is 'mysql.jdbc.odePool.OdePool'
and that the TransactionManager factory is
org.apache.ode.axis2.util.WLSFactory:

ode-axis2.db.mode=EXTERNAL
# the datasource JNDI name:
ode-axis2.db.ext.dataSource=mysql.jdbc.odePool.OdePool
# the WLS TransactionManager factory:
ode-axis2.tx.factory.class=org.apache.ode.axis2.util.WLSFactory
# pay attention, the following class moved from
'org.apache.ode.daohib.bpel' pkg to 'org.apache.ode.dao.jpa' :
ode-axis2.dao.factory=org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl
# not sure it has smth to see with persistency, but I found it in an
example, so:
ode-axis2.message.replicate.emptyns=true

========
4-  Create a datasource in WLS
+ Download and add the MySQL JDBC driver to the WLS classpath.
+ Start WLS and create a datasource (I defined the JNDI name as
mysql.jdbc.odePool.OdePool).

========
5- Start WLS
And redeploy the BPEL processes, it should work.

========
Just few highlights about performances. I tried to figure out the
impact of the <in-memory> setting on the persistency management.
The following figures give a pretty good overview - but obviously they
deserve a more detailed study.

I attach it to this email, see figures.txt.

Regards,

Vincent

Re: Ode.war; persistency with MySQL using BEA Weblogic Server

Posted by Alex Boisvert <bo...@intalio.com>.
Hi Toto,

(Not sure this is your actual name, but hey, I figured it sounded better
than Pimousse76)

1) Yes, practically Ode requires a database.  You could reimplement the DAOs
to use something different but that would require more work (this is an
understatement).

2) To use Ode in Weblogic, you'll need to implement your own
TransactionManagerFactory, similar to the JBoss
factory<http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/util/JBossFactory.java>,
to look up the TransactionManager from the JNDI context.  You'll also need
to configure ode-axis2.properties to use this factory.  This will probably
solve the OpenJPA issue you had.

cheers,
alex


On 11/23/07, Toto Toto <pi...@gmail.com> wrote:
>
> Hi everyone,
>
> As per documentation, ODE is running with an embedded db (Derby),
> through OpenJPA framework. My aim is to plug a MySQL database - for
> the time being, as the targeted candidate would likely be Oracle or
> SQL Server (anyway, the goal is identical).
>
> I read the ODE doumentation, had a look to the OpenJPA one, and I must
> admit I did not find any guide demonstrating how to unplug Derby in
> favor of MySQL. I've quote some questions below. Don't hesitate to
> re-route me to some documentation if I missed it.
>
> Thanks in advance.
>
> ========== Ecosystem
> + BEA Weblogic 10, Java 5.0
> + ODE 1.1 (downloaded the war)
> + MySQL 5.0.45
>
> ========== Is persistency mandatory?
> First, I would like to understand if ODE requires or not a DB /
> persistency mechanism.
>
> "ODE Execution Events" paragraph of the User Guide
> (http://ode.apache.org/user-guide.html) says that events are
> persisted. However, it also says that it is possible to completely
> deactivate them.
>
> "ODE Data Access Objects" paragraph of the Architectural Overview page
> (http://ode.apache.org/achitectural-overview.html) says that "the BPEL
> Engine Runtime requires DAO objects to deal with the following
> persistence issues:
> * active instances – keeping track of which instances have been created
> * message routing – which instance is waiting for which message
> * variables – the values of the BPEL variables for each instance
> * partner links – the values of the BPEL partner links for each instance
> * process execution state – the serialized state of the Jacob
> "persistent virtual machine"
> But is this also valid for short running processes? Indeed, I do not
> plan to create at all long running processes that would require to
> persist states...
>
> Finally, "Additional Settings" paragraph of
> http://ode.apache.org/creating-a-process.html page says that "[one]
> can define a process as being executed only in-memory. This greatly
> reduces the amount of generated queries and puts far less load on your
> database."
>
> Still, it is not 100% clear to me either ODE requires persistency or
> not. I would say so, but...
> By the way, what is the minimal scope of data to be persisted?
> Is
> http://svn.apache.org/viewvc/ode/trunk/dao-hibernate-db/src/main/sql/simplesched-mysql.sql?view=markup
> the only schema to create in MySQL?
>
>
> ========== Overriding persistency settings
> First, I would like to understand, in case of ode.war, at which layer
> the persistency settings have to be overriden:
> - ODE layer: I did not find any conf file directly related to ODE
> persistency config...
> - OpenJPA: I found some persistence.xml files packaged into some
> jars, but I do not think that's the right place.
> - axis level, through ode-axis2.properties.
>
> Even if I am a bit puzzled - it sounds strange to me that Axis drives
> ODE db settings... - I would say the latter case apply. Is this the
> appropriate solution?
>
> Indeed, from this link:
>
> http://groups.google.com/group/tempo-dev/browse_thread/thread/03175939ca3e395a/046b3e91222fe83d?#046b3e91222fe83d
> I understood that a ode-axis2.properties file had to be set in
> ode.war/WEB-INF/conf folder in order to override the database
> settings. Here is how mine looks like:
>
> ode-axis2.db.mode=EXTERNAL
> ode-axis2.db.ext.dataSource=java:mysql/jdbc/odePool/OdePool
> ode-axis2.tx.factory.class=org.apache.ode.axis2.util.JBossFactory
> ode-axis2.message.replicate.emptyns=true
>
> ode-axis2.dao.factory=org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl
>
> Obvisouly, this configuration produces exceptions:
>
> weblogic.application.ModuleException: [HTTP:101216]Servlet:
> "AxisServlet" failed to preload on startup in Web application: "ode".
> java.lang.reflect.InvocationTargetException
> 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:585)
> at org.apache.ode.axis2.ODEServer.initTxMgr(ODEServer.java:381)
> at org.apache.ode.axis2.ODEServer.init(ODEServer.java:141)
> at org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:47)
> at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(
> StubSecurityHelper.java:282)
> at ....
> Caused by: java.lang.RuntimeException: Error while looking up
> TransactionManager at java:/TransactionManager
> at org.apache.ode.axis2.util.JBossFactory.getTransactionManager(
> JBossFactory.java:44)
> ... 47 more
> Caused by: javax.naming.NameNotFoundException: While trying to look up
> /TransactionManager in /app/webapp/ode/20490977.; remaining name
> '/TransactionManager'
> at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(
> BasicNamingNode.java:1138)
> ...
>
> As it could have been expected, both JBossFactory and GeronimoFactory
> failed to be instanciated in the context of a Weblogic server.
> Therefore I'll have to implement one.
> Except this development, is the configuration ok?
>
> Indeed, just after this exception, I have another one, related to
> OpenJPA itself:
> <4|true|0.9.7> org.apache.openjpa.persistence.ArgumentException: A
> JDBC Driver or DataSource class name must be specified in the
> ConnectionDriverName property.
> at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(
> DataSourceFactory.java:67)
> at
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory
> (JDBCConfigurationImpl.java:797)
> at
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance
> (JDBCConfigurationImpl.java:563)
>
> It sounds to be related to
> http://openjpa.apache.org/docs/latest/manual/dbsupport_mysql.html
> If I well understood, these parameters have to be defined in an
> openjpa.xml configuration file, that should be deployed in
> ode.war/META-INF
>
> Am I right?
>
> ========
> Sorry for this long email. Any help would be greatly appreciated ;o)
>
> Regards.
>