db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilbert, Clint" <Clint.Gilb...@childrens.harvard.edu>
Subject RE: Derby in Tomcat webapps
Date Thu, 29 May 2008 16:34:45 GMT
For what it's worth, I had a problem similar to the original poster's.  Upon restarting Tomcat,
my embedded Derby DB would occasionally boot read-only, or not at all - a problem on a development
server that was bounced frequently.  This was using Hibernate and its built-in connection
pooling.  It seemed that the DB was never getting properly shut down.  

I solved the problem by running the Derby network server on my local machine and making connections
to that instead of the embedded DB.  That's a lot less slick, however, so I plan to try using
a "real" JNDI datasource in the future.


-----Original Message-----
From: Robert J. Carr [mailto:rjcarr@gmail.com]
Sent: Thu 5/29/2008 12:11 PM
To: Derby Discussion
Subject: Re: Derby in Tomcat webapps
 
> 1. When I unload and then reload the app, the new instance of the app can't
> start the database. I have to stop and then start Tomcat.

My application runs in tomcat and I can deploy and undeploy my app and
the database is fine and I'm able to reconnect.  Are you unloading the
database when you undeploy?

> 2. When I try to run a second app that uses Tomcat, it can't start the
> database.

If you are using embedded derby, as far as I know, you can only have
one active connection to it at a time.

You might be able to get around this using JNDI data sources, which I
think ties the connection to tomcat and not to your application.  I
haven't confirmed this, but it is worth a shot if you're not already
doing it (and a better practice as well).

Good luck!




Mime
View raw message