db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <k74yeung-de...@yahoo.com.sg>
Subject Derby not committing in tomcat
Date Sat, 25 Oct 2008 18:26:21 GMT
Hi all

I've read all documentations and followed all there is
to follow. I got Derby 10.4.2.0 DB running in network
server mode, copied derbyclient.jar to tomcat's
common/lib, copied JOTM to the same and in my servlet
started a JTA UserTransaction and got a DataSource
from JNDI.

However, data I inserted to the DB didn't get
committed, despite calling tx.commit(). All logging
and debug indicate a successful commit.

One thing I noticed is that the DataSource class is
"org.apache.tomcat.dbcp.dbcp.BasicDataSource" and the
Connection class is
"org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper".
I think they should be from org.derby.jdbc but I am
not sure. Is there a configuration where I tell tomcat
to use derby's own DataSourceFactory to create an XA
DataSource?

I've attached various tomcat configuration files and
would be grateful if someone would give me a hand.
Thanks, Kevin.

web.xml, amongst other things I have:
<resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/CDDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
</resource-ref>

context.xml, this one goes into
webapps/carpediem/META-INF:
<Context path="/carpediem" docBase="carpediem"
         debug="5" reloadable="true"
crossContext="true">

  <Resource name="jdbc/CDDB" auth="Container"
type="javax.sql.DataSource"
            maxActive="5" maxIdle="30" maxWait="10000"
            username="cd" password="cd"
driverClassName="org.apache.derby.jdbc.ClientDriver"
            defaultAutoCommit="false"
defaultTransactionIsolation="READ_COMMITTED"
            url="jdbc:derby://localhost:1527/CDDB"/>

  <Transaction name="UserTransaction" auth="Container"
              
type="javax.transaction.UserTransaction"
              
factory="org.objectweb.jotm.UserTransactionFactory"
               jotm.timeout="60"/>
</Context>






      New Email addresses available on Yahoo!
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/sg/


Mime
View raw message