You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by du...@kdtrading.com on 2006/04/21 00:13:02 UTC

A question about derby connection type

I changed the property of 'db.lck' to read only to make a read only
connection to derby.
I assumed that I can make read& write connection to derby  when I change
'db.lck' to writable back.
However, It didn't work as I assumed. I tried to create an index but I
got an error saying that 'DDL is not permitted for a read-only
connection, user or database.'  Anyone knows how I can make a
read&write connection again??
 

Thanks,
Duhee


Re: A question about derby connection type

Posted by Stanley Bradbury <St...@gmail.com>.
duhee.lee@kdtrading.com wrote:

>I changed the property of 'db.lck' to read only to make a read only
>connection to derby.
>I assumed that I can make read& write connection to derby  when I change
>'db.lck' to writable back.
>However, It didn't work as I assumed. I tried to create an index but I
>got an error saying that 'DDL is not permitted for a read-only
>connection, user or database.'  Anyone knows how I can make a
>read&write connection again??
> 
>
>Thanks,
>Duhee
>
>
>  
>
Hi Duhee -

db.lck is a Derby system file that should never be modified directly.  
The use that Derby makes of db.lck requires only that it be accessed at 
boot and shutdown time - any modifications made to the file between 
those two events will not be noticed. 

You have tried something that, to my knowledge, has not been tried 
before (and is unsupported and won't work).  The read-only attribute is 
associated with a connection and should be set when the connection is 
created or by using Authorization and a read-only user account or by 
creating a read-only database as documented in the manuals.  Read-only  
is set when the connection is created - it persists for the life of the 
connection.  As you discovered if Derby cannot write to the db.lck file 
it will make all connections read-only, this is an artifact rather than 
a feature.