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.

Reply via email to