Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 35448 invoked from network); 3 Nov 2006 09:22:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2006 09:22:10 -0000 Received: (qmail 60040 invoked by uid 500); 3 Nov 2006 09:22:20 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 60019 invoked by uid 500); 3 Nov 2006 09:22:20 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 60002 invoked by uid 99); 3 Nov 2006 09:22:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Nov 2006 01:22:20 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Nov 2006 01:22:07 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GfvFB-0000RJ-N3 for derby-user@db.apache.org; Fri, 03 Nov 2006 01:21:45 -0800 Message-ID: <7154282.post@talk.nabble.com> Date: Fri, 3 Nov 2006 01:21:45 -0800 (PST) From: Suraj Batuwana To: derby-user@db.apache.org Subject: Re: Issue with Derby when using with IBM WebSphere Application Server Community Edition In-Reply-To: <4547DF04.3010806@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sbatuwana@virtusa.com References: <65E39BDC90312B48BD2C4B4F9F0B5B143F900E@CS-MAILSVR02.Virtusa.com> <45410C8B.2010004@gmail.com> <65E39BDC90312B48BD2C4B4F9F0B5B143F9010@CS-MAILSVR02.Virtusa.com> <454238E0.40706@gmail.com> <454255FF.4060203@gmail.com> <7088449.post@talk.nabble.com> <4547DF04.3010806@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org 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.(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection30.(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 >> 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.(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.