db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <dan...@nuix.com.au>
Subject Re: Is it possible to force read-only mode?
Date Fri, 17 Jun 2005 02:02:41 GMT
Kathey Marsden wrote:

>Daniel Noll wrote:
>
>  
>
>>We have considered this option and discarded it for the time being.
>>
>>Basically, our application isn't client-server, and probably won't be
>>for a while... probably a long while.  We just wanted to implement a
>>cheap way for two people to look at the same database through our app
>>at the same time, possibly on different machines (the data would be
>>accessible via NFS, CIFS, or whatever.)  Since no user needs to modify
>>the database (and doing so would be bad, for various reasons) I
>>figured that read-only mode could be used to do this.
>>
>>    
>>
>
>I don't have real clarity on your configuration but I think the embedded
>server model might be appropriate for what you are doing. Your app
>continues to use embedded but you start network server in the same jvm
>to allow access by external jvms.
>You can probably test this very quickly to see if it is what you need by
>setting the property derby.drda.startNetworkServer=true  in your
>derby.properties file and starting up your application.  Then you can
>safely connect with ij  from another JVM.
>  
>
My problem is something like this (I'll use the standard naming scheme
for arbitrary users)...

Suppose that Alice and Bob both want to open a database located at
file://server/data/case-001/Database .

You're saying that Alice's app can simply start an embedded server and
that Bob's app can connect to that server.  The problems with this, as
we see it, are:

    1. Bob's app has no way to figure out which host on its subnet is
       running the server.

    2. Even if the app knows which host is running the server, it has no
       easy way to correlate the file it wants to open with a database
       URL for remote connection.

    3. If Alice decides to close her app, it will affect Bob's
       connection, and we'll need sophisticated logic to make Bob's
       app create a new embedded server, which Alice will then need
       to connect to when she fails to connect to the database.

    4. The situation becomes even more difficult if there are more
       than one app running on the same host, which happens on
       terminal server setups.  Alice might open up one database and
       Bob wants to open another, and both of these need to start
       the embedded server in case Charlie wants to open either one.

       Even if we ran each server on a different port somehow, which
       port does charlie connect to?

    5. The two hosts might not even be on the same network segment, and
       thus would be unable to intercommunicate at all.

It seems like this problem wouldn't exist at all if Derby didn't try to
lock the database.  My real question is, if I want to open it in
read-only mode anyway, what business does it have locking it from other
readers?

Daniel

-- 
Daniel Noll

NUIX Pty Ltd
Level 8, 143 York Street, Sydney 2000
Phone: (02) 9283 9010
Fax:   (02) 9283 9020

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.


Mime
View raw message