I have been playing with Orion at home using mySql and have found the same
problem, and I looked into it a bunch.

While mySql has support for transactions, its still a little immature.
Typically the DBD or Gemini libraries need to be obtained and for mySql to
compile against so that the tables can be managed with AUTOCOMMIT off.  But
this is more of an inconvenience than a real showstopper.

But more importantly the JDBC driver itself seems to not quite be ready for
handling CMP transactions.  For example, the class
org.gjt.mm.mysql.MysqlDataSource works if you instantiate it and set the
properties yourself but it doesn't follow the spec so theres no way for
Orion to properly configure it.  Even more important greping through the
source code for the driver reveals that there is nothing from
javax.transaction package anywhere which is required by the EJB 1.1 spec.

So the long and short of it is...  I've tried using mySql, it won't work
yet.  So far as both PostgresSQL and Oracle work very well as alternatives.

-----Original Message-----
From: Henrik Røn (LMD) [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 7:58 AM
To: Orion-Interest
Subject: Orion and mysql: turning autocommit off?


Hi all

In the archive there are several mails describing problems with autocommit
when using MySQL (3.23.32) and the org.gjt.mm.mysql.Driver (2.0.4)

The Cabin example from Monson-Haefel's book, which uses CMP, fails as
autocommit is not turned off:

[snip from application.log]
19-03-01 15:56 Error in bean Cabin
java.sql.SQLException: Can't call commit when autocommit=true
        at org.gjt.mm.mysql.Connection.commit(Connection.java:520)
        at com.evermind.sql.an.commit(JAX)
        at com.evermind.sql.aj.commit(JAX)
        at com.evermind.server.ejb.DataSourceConnection.commit(JAX)
        at
CabinHome_EntityHomeWrapper2.create(CabinHome_EntityHomeWrapper2.java:429)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.evermind.server.rmi.bd.run(JAX)
        at com.evermind.server.rmi.bb.hy(JAX)
        at com.evermind.server.rmi.bb.run(JAX)
        at com.evermind.util.f.run(JAX)
[end snip]

I've tried to use the property:

jdbc.nontx.autocommit=false 

in the orion.properties file, but this does not turn off autocommit. I've
also tried turning autocommit off in the MySQL DB (SET AUTOCOMMIT=0) itself,
but with no effect.

Has any one found out how to turn off autocommit?

Regards
Henrik

-----Original Message-----
From: Tim Endres [mailto:[EMAIL PROTECTED]]
Sent: 30. januar 2001 22:16
To: Orion-Interest
Subject: Re: orion and mysql?


>          I found it very easy...I use:
> http://mmmysql.sourceforge.net/ - jdbc driver
> http://javaexchange.com/ - connection pooling....
> 
> One variable i had was w/javaexchange's DBBroker, set
AutoReconnect=true...
> 
> so far so good...been using awhile

Which mysql are you using? Not all versions support transactions.
tim.


Reply via email to