db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Bortnovskiy <PBortnovs...@Jefferies.com>
Subject Using NetworkServerControl to access in-memory (only) tables of Embedded Derby
Date Fri, 05 Feb 2010 14:34:30 GMT

In my application Derby is used as an in-memory database (only) and the 
NetworkServerControl (NSC) is used to provide JDBC access to the tables.
There are two questions:

1) how can actions of those connecting to the NetworkServerControl via 
JDBC be controled (for instance, limited to read only)?

2) a more important question: it seems that if my application stops, 
waits, hangs, then the JDBC connection to NSC is broken.
It seems that NSC just stops running. I couldn't figure out how to put it 
in a separate thread, so that it's independent of other
application threads. The only other thread I could create is the 
"monitoring" thread which starts and then is continuously pinging the 
But even with this thread, the server still stops (connection breaks) if 
the application's main threads get into a wait/sleep or hang.

public class DerbyServer implements Runnable {
  private NetworkServerControl m_server;

  final public void start() throws Exception {
    new Thread(this, "Derby Server").start();

  public void run() {
    m_server = new NetworkServerControl(m_host, m_port);
    m_server.start(new PrintWriter(new LoggingOutputStream(logger, 
Level.INFO), true));

    try {
      while (!m_done.get()) {

        try {
        } catch (InterruptedException e) {
          /* log */
    } catch (Exception e) {
      /* log - errror pinging server */


Pavel <pavel.bortnovskiy@softwair-corp.com>

Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email,
including any attachments, are confidential to the ordinary user of the email address to which
it was addressed. If you are not the addressee of this email you may not copy, forward, disclose
or otherwise use it or any part of it in any form whatsoever. This email may be produced at
the request of regulators or in connection with civil litigation. Jefferies accepts no liability
for any errors or omissions arising as a result of transmission. Use by other than intended
recipients is prohibited.  In the United Kingdom, Jefferies operates as Jefferies International
Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames
Street, London EC4V 3BJ.  Jefferies International Limited is authorised and regulated by the
Financial Services Authority.
View raw message