title: Shutting down derby Network server doesnt delete db.lck
body: <p>I'm trying to start Derby in Network server mode from my Java application with default port. Server starts successfully. Now I attempt to connect to a DB called 'myDB' on the server. The connection is established and db.lck gets successfully created. I, then, do a couple of transactions, commit and close the connection, gracefully. I see that db.lck is still there. Then I shutdown the network server. I expect db.lck file deleted at the end of all these operations. But it stays. (PS: OS is Windows)</p>
  
  <p>Following is the code:</p>
  
  <p>1) Start the server:</p>
  
  <pre><code>System.setProperty("derby.system.home", "C:\\SI\\testDerby");
  System.setProperty("derby.drda.traceDirectory", "C:\\SI\\trace");
  System.setProperty("derby.drda.traceAll", "true");
  System.setProperty("derby.drda.logConnections", "true");
  System.setProperty("derby.connection.requireAuthentication", "false");
  
  serverHandle = new NetworkServerControl();
  // Write server console messages to system output
  serverHandle.start(new PrintWriter(System.out));
  </code></pre>
  
  <p>2) Connecting to DB</p>
  
  <pre><code>final String PORT = 1527;
  String driver = "org.apache.derby.jdbc.ClientDriver";
  String dbName = "myDB";
  String connectionURL = "jdbc:derby:" + "//localhost:" 
              + PORT  + "/" + dbName + ";create=true";
  Class.forName(driver).newInstance();
  Connection conn = DriverManager.getConnection(connectionURL);
  Statement stmt = conn.createStatement();
  boolean success = stmt.execute("DROP TABLE USERS");
  PreparedStatement statement = conn.prepareStatement("CREATE TABLE USERS (id BIGINT not null, name VARCHAR(20))");
  success = statement.execute();
  conn.commit();
  conn.close();
  </code></pre>
  
  <p>3) Shutting down server</p>
  
  <pre><code>serverHandle.shutdown();
  </code></pre>
  
  <p>Can anyone please help me out with this ? I need the db.lck file to be deleted when I close the connection or shutdown the DB. I think I'm missing something. Thanks in advance.</p>