db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Youngho Cho" <youn...@nannet.co.kr>
Subject Re: MySql InnoDB question
Date Thu, 23 Jun 2005 23:31:28 GMT
Hello,

Here is my test result.
I added log line into initialize() method.

It looks like the torque initialize process has a problem for checking Tranasction Support
or Not.
During initialize process, the IDBroker call the TorqueInstance for checking the Connection
support transaction.
Because the TorqueInstance doesn't initialize yet,  it always set false even the connection
support transaction.

2005-06-23 23:31:14,609 [main] DEBUG org.apache.torque.TorqueInstance - init(org.apache.commons.configuration.CompositeConfiguration@1c6a99d)
2005-06-23 23:31:14,609 [main] DEBUG org.apache.torque.TorqueInstance - setConfiguration(org.apache.commons.configuration.CompositeConfiguration@1c6a99d)
2005-06-23 23:31:14,609 [main] DEBUG org.apache.torque.TorqueInstance - initialize()
2005-06-23 23:31:14,625 [main] DEBUG org.apache.torque.TorqueInstance - setConfiguration(org.apache.commons.configuration.SubsetConfiguration@1a9876e)
2005-06-23 23:31:14,625 [main] DEBUG org.apache.torque.TorqueInstance - initAdapters(org.apache.commons.configuration.SubsetConfiguration@1a9876e)
2005-06-23 23:31:14,718 [main] DEBUG org.apache.torque.TorqueInstance - Adding mysql ->
easydesk as Adapter
2005-06-23 23:31:14,718 [main] DEBUG org.apache.torque.TorqueInstance - initDataSourceFactories(org.apache.commons.configuration.SubsetConfiguration@1a9876e)
2005-06-23 23:31:14,718 [main] DEBUG org.apache.torque.TorqueInstance - handle: easydesk DataSourceFactory:
org.apache.torque.dsfactory.SharedPoolDataSourceFactory
2005-06-23 23:31:14,828 [main] DEBUG org.apache.torque.TorqueInstance - getConfiguration()
= org.apache.commons.configuration.SubsetConfiguration@1a9876e
2005-06-23 23:31:14,828 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- Starting initCPDS
2005-06-23 23:31:14,843 [main] DEBUG org.apache.torque.TorqueInstance - getConfiguration()
= org.apache.commons.configuration.SubsetConfiguration@1a9876e
2005-06-23 23:31:14,843 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- applyConfiguration(org.apache.commons.configuration.SubsetConfiguration@135da43, org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@8c7be5)
2005-06-23 23:31:14,843 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- applyConfiguration(org.apache.commons.configuration.SubsetConfiguration@11a0d35, org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@8c7be5)
2005-06-23 23:31:14,890 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@8c7be5, driver,
org.gjt.mm.mysql.Driver)
2005-06-23 23:31:14,906 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@8c7be5, url, jdbc:mysql://localhost:3306/easydesk?zeroDateTimeBehavior=round&useNewIO=true)
2005-06-23 23:31:14,906 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@8c7be5, user, root)
2005-06-23 23:31:14,906 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@8c7be5, password,
 (value not logged))
2005-06-23 23:31:14,906 [main] DEBUG org.apache.torque.dsfactory.SharedPoolDataSourceFactory
- Starting initJdbc2Pool
2005-06-23 23:31:14,937 [main] DEBUG org.apache.torque.TorqueInstance - getConfiguration()
= org.apache.commons.configuration.SubsetConfiguration@1a9876e
2005-06-23 23:31:14,937 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- applyConfiguration(org.apache.commons.configuration.SubsetConfiguration@1015a9e, org.apache.commons.dbcp.datasources.SharedPoolDataSource@1e45a5c)
2005-06-23 23:31:14,937 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- applyConfiguration(org.apache.commons.configuration.SubsetConfiguration@e8606c, org.apache.commons.dbcp.datasources.SharedPoolDataSource@1e45a5c)
2005-06-23 23:31:14,984 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.datasources.SharedPoolDataSource@1e45a5c, maxActive,
60)
2005-06-23 23:31:14,984 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.datasources.SharedPoolDataSource@1e45a5c, maxWait,
30000)
2005-06-23 23:31:14,984 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.datasources.SharedPoolDataSource@1e45a5c, testOnBorrow,
true)
2005-06-23 23:31:14,984 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.datasources.SharedPoolDataSource@1e45a5c, timeBetweenEvictionRunsMillis,
-1)
2005-06-23 23:31:14,984 [main] DEBUG org.apache.torque.dsfactory.AbstractDataSourceFactory
- setSimpleProperty(org.apache.commons.dbcp.datasources.SharedPoolDataSource@1e45a5c, validationQuery,
SELECT 1)
2005-06-23 23:31:15,000 [main] DEBUG org.apache.torque.TorqueInstance - Adding a dummy entry
for default, mapped onto easydesk
2005-06-23 23:31:15,062 [main] DEBUG org.apache.torque.TorqueInstance - getConfiguration()
= org.apache.commons.configuration.SubsetConfiguration@1a9876e
2005-06-23 23:31:15,078 [main] ERROR org.apache.torque.oid.IDBroker - org.apache.torque.TorqueException:
Torque is not initialized.
2005-06-23 23:31:15,078 [main] WARN  org.apache.torque.oid.IDBroker - IDBroker is being used
with db 'easydesk', which does not support transactions. IDBroker attempts to use transactions
to limit the possibility of duplicate key generation.  Without transactions, duplicate key
generation is possible if multiple JVMs are used or other means are used to write to the database.
2005-06-23 23:31:15,109 [Torque - ID Broker thread] DEBUG org.apache.torque.oid.IDBroker -
IDBroker thread was started.
2005-06-23 23:31:17,703 [main] INFO  org.apache.torque.TorqueInstance - Added Manager for
Class: com.nannet.jettiger.om.JettigerUser -> com.nannet.jettiger.om.JettigerUserManager
2005-06-23 23:31:17,781 [main] DEBUG org.apache.torque.TorqueInstance - getConfiguration()
= org.apache.commons.configuration.SubsetConfiguration@1a9876e
2005-06-23 23:31:17,781 [main] DEBUG org.apache.torque.TorqueInstance - initialize finished


I could solved this problem by moving initialize finish flag set true 
when after dataSourceFactory initialize not completely finished the TorqueInstance.

[youngho@dev db-torque]$ cvs diff src/java/org/apache/torque/TorqueInstance.java
Index: src/java/org/apache/torque/TorqueInstance.java
===================================================================
RCS file: /home/cvspublic/db-torque/src/java/org/apache/torque/TorqueInstance.java,v
retrieving revision 1.11
diff -r1.11 TorqueInstance.java
149a150,151
>               isInit = true;
> 
161c163
<         isInit = true;
---
>         // isInit = true;


But I am not sure what are side effects and it is right approach.
Do we need seperate initailize process like connection setup parts and internal map and manger
builder parts ?

Also after the change, I got the following error runnig an application.

2005-06-24 07:00:51,359 [Thread-57] ERROR org.apache.torque.TorqueInstance - Error occured
while closing connection.
java.sql.SQLException: Attempted to use Connection after closed() was called.
 at org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.assertOpen(ConnectionImpl.java:86)
 at org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.close(ConnectionImpl.java:115)
 at org.apache.torque.TorqueInstance.closeConnection(TorqueInstance.java:824)
 at org.apache.torque.Torque.closeConnection(Torque.java:300)
 at org.apache.torque.util.Transaction.rollback(Transaction.java:172)
 at org.apache.torque.util.Transaction.safeRollback(Transaction.java:195)
 at com.nannet.jettiger.om.BaseActivity.save(BaseActivity.java:1344)
 at com.nannet.jettiger.om.BaseActivity.save(BaseActivity.java:1319)


I am not sure is it also torque problem or our application problem.
Does any one has similar problem ?


----- Original Message ----- 
From: "Thomas Fischer" <fischer@seitenbau.net>
To: "Apache Torque Users List" <torque-user@db.apache.org>
Sent: Thursday, June 23, 2005 4:39 PM
Subject: Re: MySql InnoDB question


> 
> 
> 
> 
> Hi,
> 
> I am rather sure that this will not solve the problem, as the problem is
> probably not in the IdBroker, but somewhere else.
> Usually, if you see this message, there is something wrong in the
> configuration. It would help to read the logs; if you do not have any, you
> should configure logging for your application to find the error.
> 
>      Thomas
> 
> 
> Andras Balogh <andras@reea.net> schrieb am 23.06.2005 09:02:00:
> 
> > Hello,
> >
> > How did you configured the idMethod in your schema? You don't need
> > IDBroker since mysql should
> > support auto increment primary keys so you should go with
> > idMethod="native" for tables with auto increment
> > primary key.
> >
> > Best regards,
> > Andras.
> >
> >
> > Youngho Cho wrote:
> >
> > >Hello,
> > >
> > >I read TRQ278 for InnoDB related Issue.
> > >It is about create tables and fk relations issue.
> > >In my case, when I create tables using generated sql from xml.
> > >I set SET FOREIGN_KEY_CHECKS=0; before execute the sql.
> > >Than there is no complain.
> > >
> > >My problem is I would like to use transaction but the warn report
> > said torque doesn't use transaction.
> > >I use connector/j-3.1.7 driver.
> > >Do I have to ask it to mysql driver mailling list ?
> > >How you use torque with InnoDB ?
> > >
> > >Thanks.
> > >
> > >Youngho
> > >
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
Mime
View raw message