You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Hassan Abolhassani <ns...@ybb.ne.jp> on 2003/12/30 18:40:17 UTC

Runtime error

Hi,

I have a db schema with all tables using defaultIdMethod="native"
definition. However when I run the application I get following message and
execution is halted:

[WARN] IDBroker - -IDBroker is being used with db 'M3C', which does
not support transactions. IDBroker attempts to use transactions to limit the
pos
sibility of duplicate key generation.  Without transactions, duplicate key
gener
ation is possible if multiple JVMs are used or other means are used to write
to
the database.

What is the solution. I am using mysql as DBMS.

Hassan


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Runtime error

Posted by Hassan Abolhassani <ns...@ybb.ne.jp>.
I get the exception when try to insert data in a program using Torque.

Here is my properties file:

torque.applicationRoot = .
log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file =
${torque.applicationRoot}/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p
%c - %m%n
log4j.appender.org.apache.torque.append = false
torque.defaults.pool.logInterval = 0
torque.defaults.pool.connectionWaitTimeout = 10
torque.defaults.pool.defaultMaxConnections = 80
torque.defaults.pool.maxExpiryTime = 3600
torque.defaults.connection.driver = org.gjt.mm.mysql.Driver
torque.defaults.connection.url = jdbc:mysql://127.0.0.1/m3c
torque.defaults.connection.user = root
torque.defaults.connection.password = password
torque.database.default=m3c
torque.database.m3c.adapter=mysql
torque.dsfactory.m3c.factory=org.apache.torque.dsfactory.SharedPoolDataSourc
eFactory
torque.dsfactory.m3c.pool.defaultMaxActive=10
torque.dsfactory.m3c.pool.testOnBorrow=true
torque.dsfactory.m3c.pool.validationQuery=SELECT 1
torque.dsfactory.m3c.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.m3c.connection.url = jdbc:mysql://127.0.0.1/m3c
torque.dsfactory.m3c.connection.user = root
torque.dsfactory.m3c.connection.password = leila168
torque.idbroker.cleverquantity=true
torque.manager.useCache = true

And the output when I execute the program:

[DEBUG] TorqueInstance - -init(Torque.properties)
[DEBUG] TorqueInstance - -Config Object is
org.apache.commons.configuration.Prop
ertiesConfiguration@1a679b7
[DEBUG]
TorqueInstance - -init(org.apache.commons.configuration.PropertiesConfig
uration@1a679b7)
[DEBUG]
TorqueInstance - -setConfiguration(org.apache.commons.configuration.Prop
ertiesConfiguration@1a679b7)
[DEBUG] TorqueInstance - -initialize()
[DEBUG]
TorqueInstance - -setConfiguration(org.apache.commons.configuration.Base
Configuration@4741d6)
[DEBUG]
TorqueInstance - -initAdapters(org.apache.commons.configuration.BaseConf
iguration@4741d6)
[DEBUG] TorqueInstance - -Adding mysql -> m3c as Adapter
[DEBUG]
TorqueInstance - -initDataSourceFactories(org.apache.commons.configurati
on.BaseConfiguration@4741d6)
[DEBUG] TorqueInstance - -handle: m3c DataSourceFactory:
org.apache.torque.dsfac
tory.SharedPoolDataSourceFactory
[DEBUG] AbstractDataSourceFactory - -Starting initCPDS
[DEBUG] TorqueInstance - -getConfiguration() =
org.apache.commons.configuration.
BaseConfiguration@4741d6
[DEBUG]
AbstractDataSourceFactory - -applyConfiguration(org.apache.commons.confi
guration.BaseConfiguration@12a54f9,
org.apache.commons.dbcp.cpdsadapter.DriverAd
apterCPDS@30e280)
[DEBUG] ConvertUtils - -Convert string 'org.gjt.mm.mysql.Driver' to class
'java.
lang.String'
[ERROR] AbstractDataSourceFactory - -Property: driver value:
org.gjt.mm.mysql.Dr
iver is not supported by DataSource:
org.apache.commons.dbcp.cpdsadapter.DriverA
dapterCPDS
[DEBUG] ConvertUtils - -Convert string 'jdbc:mysql://127.0.0.1/m3c' to class
'ja
va.lang.String'
[DEBUG]
AbstractDataSourceFactory - -setSimpleProperty(org.apache.commons.dbcp.c
pdsadapter.DriverAdapterCPDS@30e280, url, jdbc:mysql://127.0.0.1/m3c)
[DEBUG] ConvertUtils - -Convert string 'root' to class 'java.lang.String'
[DEBUG]
AbstractDataSourceFactory - -setSimpleProperty(org.apache.commons.dbcp.c
pdsadapter.DriverAdapterCPDS@30e280, user, root)
[DEBUG] ConvertUtils - -Convert string 'leila168' to class
'java.lang.String'
[DEBUG]
AbstractDataSourceFactory - -setSimpleProperty(org.apache.commons.dbcp.c
pdsadapter.DriverAdapterCPDS@30e280, password, leila168)
[DEBUG]
AbstractDataSourceFactory - -applyConfiguration(org.apache.commons.confi
guration.BaseConfiguration@6d084b,
org.apache.commons.dbcp.cpdsadapter.DriverAda
pterCPDS@30e280)
[DEBUG] ConvertUtils - -Convert string 'org.gjt.mm.mysql.Driver' to class
'java.
lang.String'
[ERROR] AbstractDataSourceFactory - -Property: driver value:
org.gjt.mm.mysql.Dr
iver is not supported by DataSource:
org.apache.commons.dbcp.cpdsadapter.DriverA
dapterCPDS
[DEBUG] ConvertUtils - -Convert string 'jdbc:mysql://127.0.0.1/m3c' to class
'ja
va.lang.String'
[DEBUG]
AbstractDataSourceFactory - -setSimpleProperty(org.apache.commons.dbcp.c
pdsadapter.DriverAdapterCPDS@30e280, url, jdbc:mysql://127.0.0.1/m3c)
[DEBUG] ConvertUtils - -Convert string 'root' to class 'java.lang.String'
[DEBUG]
AbstractDataSourceFactory - -setSimpleProperty(org.apache.commons.dbcp.c
pdsadapter.DriverAdapterCPDS@30e280, user, root)
[DEBUG] ConvertUtils - -Convert string 'leila168' to class
'java.lang.String'
[DEBUG]
AbstractDataSourceFactory - -setSimpleProperty(org.apache.commons.dbcp.c
pdsadapter.DriverAdapterCPDS@30e280, password, leila168)
[DEBUG] SharedPoolDataSourceFactory - -Starting initJdbc2Pool
[DEBUG] TorqueInstance - -getConfiguration() =
org.apache.commons.configuration.
BaseConfiguration@4741d6
[DEBUG]
AbstractDataSourceFactory - -applyConfiguration(org.apache.commons.confi
guration.BaseConfiguration@66e815,
org.apache.commons.dbcp.datasources.SharedPoo
lDataSource@ece65)
[ERROR] AbstractDataSourceFactory - -Property: logInterval value: 0 is not
suppo
rted by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
[ERROR] AbstractDataSourceFactory - -Property: connectionWaitTimeout value:
10 i
s not supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDat
aSource
[ERROR] AbstractDataSourceFactory - -Property: defaultMaxConnections value:
80 i
s not supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDat
aSource
[ERROR] AbstractDataSourceFactory - -Property: maxExpiryTime value: 3600 is
not
supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDataSourc
e
[DEBUG]
AbstractDataSourceFactory - -applyConfiguration(org.apache.commons.confi
guration.BaseConfiguration@18fb1f7,
org.apache.commons.dbcp.datasources.SharedPo
olDataSource@ece65)
[ERROR] AbstractDataSourceFactory - -Property: defaultMaxActive value: 10 is
not
 supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDataSour
ce
[DEBUG] ConvertUtils - -Convert string 'true' to class 'boolean'
[ERROR] AbstractDataSourceFactory - -Property: testOnBorrow value: true is
not s
upported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDataSource

[DEBUG] ConvertUtils - -Convert string 'SELECT 1' to class
'java.lang.String'
[ERROR] AbstractDataSourceFactory - -Property: validationQuery value: SELECT
1 i
s not supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDat
aSource
[DEBUG] TorqueInstance - -Adding a dummy entry for default, mapped onto m3c
[DEBUG] TorqueInstance - -getConfiguration() =
org.apache.commons.configuration.
BaseConfiguration@4741d6
[WARN] IDBroker - -IDBroker is being used with db 'M3C', which does not
support
transactions. IDBroker attempts to use transactions to limit the possibility
of
duplicate key generation.  Without transactions, duplicate key generation is
pos
sible if multiple JVMs are used or other means are used to write to the
database
.
[DEBUG] IDBroker - -IDBroker thread was started.
[Ljava.lang.StackTraceElement;@1b1aa65
java.lang.NullPointerException: There was no DataSourceFactory configured
for th
e connection M3C
        at
org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:74
9)
        at org.apache.torque.Torque.getConnection(Torque.java:306)
        at
org.apache.torque.util.Transaction.beginOptional(Transaction.java:118
)
        at org.apache.torque.util.Transaction.begin(Transaction.java:100)
        at com.m3c.bo.BaseHospital.save(BaseHospital.java:2775)
        at com.m3c.bo.BaseHospital.save(BaseHospital.java:2756)
        at com.m3c.bo.OMFacade.insertHospital(OMFacade.java:107)
        at com.m3c.bo.OMFacade.insertHospital(OMFacade.java:95)
        at com.m3c.junit.bo.OMFacadeTest.testInsert(OMFacadeTest.java:33)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at junit.textui.TestRunner.doRun(TestRunner.java:109)
        at junit.textui.TestRunner.run(TestRunner.java:72)
        at com.m3c.junit.bo.OMFacadeTest.main(OMFacadeTest.java:23)



----- Original Message ----- 
From: "Sonu Vijay" <so...@yahoo.com>
To: "Apache Torque Users List" <to...@db.apache.org>
Sent: Wednesday, December 31, 2003 10:35 AM
Subject: Re: Runtime error


> i guess posting ur property files would help people to
> understand what's going on. At what point do u get
> this error message ?
>
>
> --- Hassan Abolhassani <ns...@ybb.ne.jp> wrote:
> > Hi,
> >
> > I have a db schema with all tables using
> > defaultIdMethod="native"
> > definition. However when I run the application I get
> > following message and
> > execution is halted:
> >
> > [WARN] IDBroker - -IDBroker is being used with db
> > 'M3C', which does
> > not support transactions. IDBroker attempts to use
> > transactions to limit the
> > pos
> > sibility of duplicate key generation.  Without
> > transactions, duplicate key
> > gener
> > ation is possible if multiple JVMs are used or other
> > means are used to write
> > to
> > the database.
> >
> > What is the solution. I am using mysql as DBMS.
> >
> > Hassan
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> > torque-user-help@db.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
>
> ---------------------------------------------------------------------
> 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


Re: Runtime error

Posted by Sonu Vijay <so...@yahoo.com>.
i guess posting ur property files would help people to
understand what's going on. At what point do u get
this error message ?


--- Hassan Abolhassani <ns...@ybb.ne.jp> wrote:
> Hi,
> 
> I have a db schema with all tables using
> defaultIdMethod="native"
> definition. However when I run the application I get
> following message and
> execution is halted:
> 
> [WARN] IDBroker - -IDBroker is being used with db
> 'M3C', which does
> not support transactions. IDBroker attempts to use
> transactions to limit the
> pos
> sibility of duplicate key generation.  Without
> transactions, duplicate key
> gener
> ation is possible if multiple JVMs are used or other
> means are used to write
> to
> the database.
> 
> What is the solution. I am using mysql as DBMS.
> 
> Hassan
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> torque-user-help@db.apache.org
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org