Well..... I must apologize for this discussion as the problem has nothing to
do with Derby.
I am using Java Service Wrapper (Tanuki Software) and the wrapper has a
timeout at the application starting which stop the JVM and try to reload the
application if there is no response after 30 seconds. And the database
creation is more than 30 seconds on my server (it is a dedicated server but
with a shared disk). So setting a higher timeout solves the problem. The
same operation is so quick on my local machine that I didn't think to that
explanation ! Finally, founding the jira report bug let me think that there
was a real problem in Derby ;-)
I am very sorry for the disturbing !!
Sincerely,
JY LINET
----- Original Message -----
From: "Kristian Waagan" <[email protected]>
To: "Derby Discussion" <[email protected]>
Sent: Thursday, September 03, 2009 11:20 AM
Subject: Re: LINUX Hang on creation - ERROR XBM0J Directory already exists
onsecond load
d...@xx wrote:
Hi,
I have developped my application under Windows XP and everything is
working correctly.
Now I start testing under LINUX but without success.
When I start first time the embedded driver with create=true option, the
application hang but the database seams created, except that the
service.properties file doesn't exists (compare to Windows files).
Hello,
What you describe looks similar to
https://issues.apache.org/jira/browse/DERBY-4098
To start with a few general things:
- Does creating and then booting the database work when using ij only?
(ij is the Derby command line tool)
- Are you sure the application code isn't touching the database directory
or the services.properties file?
- Is it possible to limit DBCP to a single connection?
(rule out race conditions during creation/boot)
- Is it hard for you to switch to the client driver?
(for testing only, and remember to start the network server)
- Have you tried your application on several Linux machines, or only one?
- Are you able to write something that will monitor your system for all
accesses to the service.properties?
(i.e something like DTrace on Solaris).
The fact that the file doesn't exist may be a problem...
Regards,
--
Kristian
The derby.log seams "normal" :
----------------------------------------------------------------
2009-09-03 08:42:56.580 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.5.1.1 - (764942): instance a816c00e-0123-7f12-1804-00002387de98 on
database directory /home/idaxx/demo/srv/db/dataxx
Database Class Loader started - derby.database.classpath=''
When I restart the application I have the ERROR XBM0J. So it seams that
the creation is uncomplete.
The derby.log is :
2009-09-03 08:45:04.951 GMT Thread[WrapperListener_start_runner,5,main]
Cleanup action starting
ERROR XBM0J: Directory
/home/idaxx/demo/srv/db//home/idaxx/demo/srv/db/dataxx already exists.
at
org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at
org.apache.derby.impl.services.monitor.StorageFactoryService$9.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown
Source)
at
org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
at
org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown
Source)
at
org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown
Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown
Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at
fr.proxiflex.axx.db.Pool.getDataSourceConnection(Pool.java:236)
at fr.proxiflex.axx.db.PXConnection.<init>(PXConnection.java:45)
at fr.proxiflex.axx.db.Pool.getConnection(Pool.java:241)
at fr.proxiflex.axx.db.PoolList.getConnection(PoolList.java:136)
at fr.proxiflex.axx.db.DBContext.getConn(DBContext.java:111)
at fr.proxiflex.axx.db.DBContext.getConn(DBContext.java:93)
at fr.proxiflex.axx.Module.beforeInit(Module.java:234)
at
fr.proxiflex.axx.server.ModuleAbstract.init(ModuleAbstract.java:34)
at
fr.proxiflex.axx.server.DemuxIoHandler.initModule(DemuxIoHandler.java:353)
at
fr.proxiflex.axx.server.DemuxIoHandler.initModules(DemuxIoHandler.java:330)
at
fr.proxiflex.axx.server.DemuxIoHandler.<init>(DemuxIoHandler.java:187)
at fr.proxiflex.axx.server.PXServer.start(PXServer.java:232)
at
org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2979)
Cleanup action completed
2009-09-03 08:45:04.973 GMT Thread[WrapperListener_start_runner,5,main]
Cleanup action starting
java.sql.SQLException: Failed to create database 'directory:dataxx', see
the next exception for details.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown
Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown
Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFacto
ry.java:38)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory
I made searches on internet and tried a lot of differents ways to define
the databasename and the home directory but without success.
Thanks for help...
JY LINET