[jira] [Commented] (DERBY-6930) Embedded driver database remains locked after close

2017-04-01 Thread Alastair Rae (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-6930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15952290#comment-15952290
 ] 

Alastair Rae commented on DERBY-6930:
-

The question arises from using Squirrel SQL client with a JDBC connection to 
the database. When you disconnect, Squirrel calls Connection.close() but this 
leaves the database locked. 

> Embedded driver database remains locked after close
> ---
>
> Key: DERBY-6930
> URL: https://issues.apache.org/jira/browse/DERBY-6930
> Project: Derby
>  Issue Type: Bug
>  Components: Miscellaneous
>Affects Versions: 10.12.1.1
> Environment: OS X and Ubuntu
>Reporter: Alastair Rae
>Priority: Minor
>
> 1 Open and close a local embedded database in one process.
> 2 Open the database from another process - it fails with ERROR XJ040
> Simple test program:
> {code}
> public static void main(String[] args) {
> Properties p = new Properties();
> p.setProperty("user", "dummy");
> p.setProperty("password", "dummy");
> String url = "jdbc:derby:/tmp/database;create=true";
> try {
> Connection c = DriverManager.getConnection(url, p);
> c.close();
> System.out.println("closed");
> Thread.sleep(1L);
> System.out.println("ok");
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> {code}
> After the first close I can see:
> {quote}
> $ fuser /tmp/database/*
> /tmp/database/dbex.lck: 13060
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DERBY-6930) Embedded driver database remains locked after close

2017-04-01 Thread Bryan Pendleton (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-6930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15952281#comment-15952281
 ] 

Bryan Pendleton commented on DERBY-6930:


There's a difference between closing a connection, vs. shutting down the 
database engine.

Is that what your question is about?

Here's a bit of docs:

* Shutting down Derby or an individual database:  
https://db.apache.org/derby/docs/10.13/devguide/tdevdvlp40464.html

* Working with multiple connections to a single database: 
https://db.apache.org/derby/docs/10.13/devguide/cdevconcepts34828.html

> Embedded driver database remains locked after close
> ---
>
> Key: DERBY-6930
> URL: https://issues.apache.org/jira/browse/DERBY-6930
> Project: Derby
>  Issue Type: Bug
>  Components: Miscellaneous
>Affects Versions: 10.12.1.1
> Environment: OS X and Ubuntu
>Reporter: Alastair Rae
>Priority: Minor
>
> 1 Open and close a local embedded database in one process.
> 2 Open the database from another process - it fails with ERROR XJ040
> Simple test program:
> {code}
> public static void main(String[] args) {
> Properties p = new Properties();
> p.setProperty("user", "dummy");
> p.setProperty("password", "dummy");
> String url = "jdbc:derby:/tmp/database;create=true";
> try {
> Connection c = DriverManager.getConnection(url, p);
> c.close();
> System.out.println("closed");
> Thread.sleep(1L);
> System.out.println("ok");
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> {code}
> After the first close I can see:
> {quote}
> $ fuser /tmp/database/*
> /tmp/database/dbex.lck: 13060
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)