Hi Alexis, Now that I am able to run ODE with mysql and hibernate, I like to know the issue with JPA dao implementation. I read from one of the threads in the mailing lists (link to thread<http://www.nabble.com/Unknown-column-%27properties0_.propId%27-in-%27field-list%27-td18812393.html>) that hibernate is mostly deprecated. So I would like to know whether we can get the full implementation of class org.apache.ode.dao.jpa.BPELDAOConnectionImpl. Currently some of the methods in this class are not implemented and hence we are not able to use the management API while listening for events.
Thanks, Nagendra. On Wed, Jan 7, 2009 at 4:47 PM, Nagendra Inuguri <[email protected]>wrote: > Hi Alexis, > > Thanks for this. I am able to generate the schema for mysql. Here are my > observations which may be helpful to others. > > STORE_ table schemas are not included in the mysql.sql file. I have used > store.sql to create these tables. I had to modify this sql file a bit to > make it work on mysql database. > > I also had to modify LARGE_DATA table schema in mysql.sql file to make > BIN_DATA column of type longblob. By default the type was blob(2g) which is > not recognized by mysql database. > > After doing these things every thing works fine. I am attaching the final > database schema scripts I have used for mysql database. > > Thanks, > Nagendra > > > On Wed, Jan 7, 2009 at 12:34 AM, Alexis Midon <[email protected]> wrote: > >> done in trunk as well. >> >> Alexis >> >> >> On Tue, Jan 6, 2009 at 10:59 AM, Alexis Midon <[email protected]> wrote: >> >> > The Rakefile can generate the schema for you, I just added added mysql >> to >> > the list of databases (in branch 1.X). >> > If you're using a subversion checkout, simply update. Otherwise edit the >> > Rakefile and apply the patch manually. >> > http://svn.apache.org/viewvc?view=rev&revision=732052 >> > >> > Then, after a build, you should have a file named mysql.sql >> > >> > Alexis >> > >> > >> > >> > On Tue, Jan 6, 2009 at 2:09 AM, Nagendra Inuguri <[email protected] >> >wrote: >> > >> >> Hi Alexis, >> >> >> >> I did a rake build to generate schemas using dao-hibernate-db module. >> >> However it doesn't generate schema for mysql. It generated for oracle, >> >> derby, hsql, firebird, postgres and sqlserver. I took derby.sql and >> modified >> >> the schema to make it work on mysql database. However I am getting the >> >> following exception while trying to deploy a process (Full Stack trace >> >> attached): >> >> >> >> ERROR - GeronimoLog.error(104) | Field 'ID' doesn't have a default >> value >> >> 15:10:16,453 ERROR [JDBCExceptionReporter] Field 'ID' doesn't have a >> >> default value >> >> ERROR - GeronimoLog.error(108) | DbError >> >> org.hibernate.exception.GenericJDBCException: could not insert: >> >> [org.apache.ode.daohib.bpel.hobj.HProcess] >> >> >> >> Thanks, >> >> Nagendra >> >> On Tue, Jan 6, 2009 at 11:44 AM, Nagendra Inuguri <[email protected] >> >wrote: >> >> >> >>> Hi Alexis, >> >>> >> >>> Thanks for your reply. Good to know that JPA and hibernate uses >> different >> >>> database schemas. Where can I find the sql statements to create >> >>> hibernate compliant tables in mysql? >> >>> >> >>> Can you also please let me know why >> org.apache.ode.dao.jpa.BPELDAOConnectionImpl class doesn't implement >> bpelEventQuery and >> >>> bpelEventTimelineQuery methods? These methods are called while using >> >>> management API and hence I am getting an >> UnsupportedOperationException. >> >>> >> >>> Thanks, >> >>> Nagendra >> >>> >> >>> On Tue, Jan 6, 2009 at 1:28 AM, Alexis Midon <[email protected]> >> wrote: >> >>> >> >>>> Hi Nagendra, >> >>>> >> >>>> you're getting that error because you cannot use Hibernate with a JPA >> >>>> database schema. Schemas are not the same for Hibernate and JPA. >> >>>> >> >>>> So to fix your issue, you have to point ODE to a database containing >> the >> >>>> Hibernate data model. >> >>>> The schemas files are generated by the module "dao-hibernate-db". >> >>>> >> >>>> Alexis >> >>>> >> >>>> >> >>>> On Sun, Jan 4, 2009 at 10:54 PM, Nagendra Inuguri < >> [email protected] >> >>>> >wrote: >> >>>> >> >>>> > Hi, >> >>>> > >> >>>> > I am using ODE with mysql database. My ode-axis2.properties file >> has >> >>>> the >> >>>> > following settings: >> >>>> > >> >>>> > ode-axis2.db.mode=EXTERNAL >> >>>> > >> >>>> > ode-axis2.db.ext.dataSource=java:comp/env/jdbc/ODEDB >> >>>> > >> >>>> > >> >>>> > Everything works fine with these settings. However when I try to >> use >> >>>> > management API to receive events, I get the following error. (Full >> >>>> stack >> >>>> > trace attached in ode-mysql-jpa.txt): >> >>>> > >> >>>> > ERROR - GeronimoLog.error(108) | Exception during database >> operation >> >>>> > >> >>>> > java.lang.UnsupportedOperationException >> >>>> > >> >>>> > at >> >>>> > >> >>>> >> org.apache.ode.dao.jpa.BPELDAOConnectionImpl.bpelEventQuery(BPELDAOConnectionImpl.java:54) >> >>>> > >> >>>> > >> >>>> > When I see the ODE source I came to know that this is happening >> >>>> because >> >>>> > org.apache.ode.dao.jpa.BPELDAOConnectionImpl has a couple of >> methods >> >>>> that >> >>>> > throws UnsupportedOperationException. Why are these methods >> >>>> (bpelEventQuery, >> >>>> > bpelEventTimelineQuery) simply throwing this exception? By default >> ode >> >>>> uses >> >>>> > this jpa dao implementation. Am I supposed to use a different dao >> >>>> > implementation? >> >>>> > >> >>>> > >> >>>> > So I tried adding the following line in ode-axis2.properties to use >> >>>> > hibernate dao implementation: >> >>>> > >> >>>> > >> >>>> > >> >>>> >> ode-axis2.dao.factory=org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl >> >>>> > >> >>>> > After adding this line management API works fine. However while >> >>>> deploying a >> >>>> > process I am getting the following error (Full stack trace attached >> in >> >>>> > ode-mysql-hibernate.txt): >> >>>> > >> >>>> > ERROR - GeronimoLog.error(104) | Unknown column >> 'properties0_.propId' >> >>>> in >> >>>> > 'field list' >> >>>> > >> >>>> > 12:02:00,484 ERROR [JDBCExceptionReporter] Unknown column >> >>>> > 'properties0_.propId' in 'field list' >> >>>> > >> >>>> > ERROR - GeronimoLog.error(108) | DbError >> >>>> > >> >>>> > org.hibernate.exception.SQLGrammarException: could not initialize a >> >>>> > collection: [org.apache.ode.store.hib.ProcessConfDaoImpl. >> >>>> > >> >>>> > properties_#{http://soa-matrix.com/example}Flow-1<http://soa-matrix.com/example%7DFlow-1> >> <http://soa-matrix.com/example%7DFlow-1> >> >>>> <http://soa-matrix.com/example%7DFlow-1> >> >>>> > ] >> >>>> > >> >>>> > >> >>>> > >> >>>> > To summarize, if I use mysql with default dao implementation (which >> is >> >>>> in >> >>>> > jpa package), I am not able to use management API. If I use mysql >> with >> >>>> > hibernate dao implementation, I am getting an error while deploying >> a >> >>>> > process. Is there any work around for this problem? >> >>>> > >> >>>> > >> >>>> > Thanks, >> >>>> > >> >>>> > Nagendra >> >>>> > >> >>>> >> >>> >> >>> >> >> >> > >> > >
