Stuart,
    Yes, it is running in a REPL right now, but I have gone to the
extent of unloading NetBeans (and I assume clojure) fully (no java
processes running), and still the lock file remains. But it does not
prevent me from reloading my clojure project in NetBeans and re-
connecting. However, NetBeans database browsing service cannot log
onto the same database, until the lock file is removed.

Jeff,  I guess it surprises me that closing the connection doesn't
remove the lock file, but maybe that has something to do with JDBC
connection pooling?? Don't know for sure, that WAS a good idea to
peruse the derby source code in the connection logic. Derby
documentation recommends shutting down embedded server's in java (and
therefore clojure) programs before the app exits, although early
experiments in that do not appear to affect this lock file.

Thanks for the advice and experience all,
Brian

On Feb 17, 2:59 pm, Jeff Valk <jv-li...@tx.rr.com> wrote:
> I've seen the same thing with embedded Derby while using SLIME. From within 
> the REPL I was always able to reconnect to the same database, so it didn't 
> really impact me. Outside the REPL I didn't notice a problem.
>
> If it holds you up, here's one observation you might investigate. Calling 
> (.close conn) doesn't remove the lock file, however causing a new connection 
> to fail does. It seems the embedded Derby driver may have some locking 
> clean-up logic in its connect call. Perhaps browsing the Derby source might 
> show how to invoke the real "release lock" method.
>
> - Jeff
>
> On Tuesday 17 February 2009 12:57, Stuart Sierra wrote:
>
>
>
> > Is your Clojure app running in a REPL?  I've run into situations where
> > it seems like the Derby lock file doesn't go away until the Clojure
> > process terminates.
>
> > -Stuart Sierra
>
> > On Feb 17, 10:28 am, BrianS <bstephen...@enclojure.org> wrote:
> > > Has anyone had experience creating clojure applications that use the
> > > embedded derby database driver? I am having an issue where I am unable
> > > to get the derby embedded database to shut down properly from within
> > > clojure.
>
> > > More specifically, whenever a java app accesses a derby embedded
> > > database, it creates a lock file to prevent other apps from accessing
> > > the db and corrupting it. This file should be removed in a proper
> > > shutdown of a derby database, but so far, even though I appear to have
> > > gotten the derby database engine to shutdown from within clojure with
> > > (java.sql.DriverManager/getConnection "jdbc:derby:;shutdown=true"),
> > > the lock file still remains, and no app can access the derby database
> > > until the db.lck file is deleted manually.
>
> > > I assumed this file would be deleted automagically during database
> > > shutdown, but is this actually something my app should do manually
> > > after shutting down its derby database? Thanks in advance for any
> > > assistance, I appreciate that this is only marginally a clojure issue.
>
> > > Brian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to