db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suraj Batuwana <sbatuw...@virtusa.com>
Subject Re: Issue with Derby when using with IBM WebSphere Application Server Community Edition
Date Fri, 03 Nov 2006 09:21:45 GMT

Hi Suresh,
I have able to connect to the connect to the database using IJ 
and performed some queries on the database. Is that means it has a file
descriptors problem ? 
how do we over come such an issue ?

While I am testing for derby/WASCE i got another requirement, that is to
deploy my application in 
WAS6.0.2.5/derby10.2.1.6. But this time the requirement was to use the
embedded driver. 

So I have used the org.apache.derby.jdbc.EmbeddedDriver as the jdbc driver
and jdbc:derby:TestDB as 
the database URL

This time I got a different error from the client side test classes
Can't connect to url=jdbc:derby:TestDB
java.sql.SQLException: Failed to start database 'TestDB', see the next
exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(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.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)

from the server side error was 
Caused by: java.sql.SQLException: Failed to start database
'E:\source\database\TestDB', see the next exception for details.DSRA0010E:
SQL State = XJ040, Error Code = 40,000DSRA0010E: SQL State = XJ040, Error
Code = 40,000
	at sun.reflect.GeneratedConstructorAccessor498.newInstance(Unknown Source)
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled
Code))
	at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled
Code))
	at
com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(GenericDataStoreHelper.java:501)
	at
com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:544)
	at
com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:1037)

I have used the follings to create websphere derby datasource
	implementing class    
"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"
	implementing class for XA     "org.apache.derby.jdbc.EmbeddedXADataSource"
	dataSource Helper Class Name    
"com.ibm.websphere.rsadapter.DerbyDataStoreHelper"
	
I have test this with ibm jdk 1.4.2. Is this happening due to the same kind
of a issue as you described ?
But this time i did not get any errors on derby.log

Thanks,
Suraj



Suresh Thalamati wrote:
> 
> Suraj Batuwana wrote:
>> Hi Suresh,
>> 
> 
>> 3.I do not see any files with zero length in the <database name> 
>> seg0 directory of the database.
> 
> That's good news. zero-length files are the real scary ones.
> 
>> 
>> 4) I am able to reproduce this error consistently on a new database also.
>> 
>> 5) I have attached my derby.log for your reference.
>> 
>> Looking at that I have found several interesting things.(I am assuming)
>> While the nightly build tests are happing with derby/WASCE the derby
>> shuting
>> down and booting its instances. It seems that shuting down of instances
>> are
>> happening while the live connections are still there.
>> 
>> But when I running the same code base with derby/websphere 6.0.2.5 only
>> one
>> time boot up is happend. here It tries to shutdown and boot up the
>> instance
>> several times. Is there a way to stop or controll the  shuting down and
>> boot
>> up the derby instance.
> 
> Thanks for providing more info on this problem. By looking at the 
> derby.log , the reason you are seeing many boot/shutdown sequences is 
> when  derby fails to open the container file, it is serious error , so 
> it shutdown the database automatically to avoid any chance for 
> corruptions.  When a next attempt was made to connect to the database 
> ,it is attempting to boot again.
> 
> 
> I looked at the stacks in the derby.log.  Real problem seems to be for 
> some reason , derby engine is not unable to open the container files. 
> It is happening while compiling a query and also during boot on 
> recovery. That makes me inclined to believe it is an environment issue.
> 
> D:\wasce_build\TestBuild\build1\target\sampledb\seg0\c5d1.dat (Cannot 
> create a file when that file already exists) at 
> java.io.RandomAccessFile.open(Native Method) at 
> java.io.RandomAccessFile.<INIT>(RandomAccessFile.java(Compiled Code))
> 
>  From the derby.log : unable to open these two files seg0\c5d1.dat and 
> seg0\c2d0.dat.
> 
> Please check the permissions/owner ship of the file in the seg0. 
> Typically the reason will be "Access denied ....". So I doubt
> that is the case.
> 
> I wrote a small program to find what causes  "Cannot create a file 
> when that file already exists" error case,  only time I am able to hit 
> that is when system ran out of file handles(file descriptors).
> 
> After bit of googling found a reporred bug on jdk142 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4189011,  may be 
> you are hitting this one.
> 
> When I tried my small program on jdk15, it managed to open 10000 
> files, whereas on jdk142 (both on ibm and sun)  it was failing
> around 2020 .
> 
> Derby does need so many file handles, it might be that something else 
> is leaking the file descriptors  and derby is failing as side-effect. 
>   It might be worth finding, all the open file handles on the system 
> when this error occurs. I don't know how to do that on Windows.
> 
> One another thing,  I would try is  after you hit the error. Shutdown 
> WAS and the network server and then  connect to the database using IJ 
> and see if you can perform some queries on the database. If this works 
> then is most likely a file descriptors problem.
> 
> Thanks
> -suresh
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-with-Derby-when-using-with-IBM-WebSphere-Application-Server-Community-Edition-tf2512964.html#a7154282
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message