Anyone have experience with Derby database?

Associate
Joined
20 May 2007
Posts
441
Heya everyone,

For a uni project I have to use derby and everything was going fine but all of a sudden the database only seems to want to fun in read only mode, when I query the database to make it change anything I get the following error message:

Code:
ERROR 25503: DDL is not permitted for a read-only connection, user or database.

I looked at the log for derby and this is all that was in it:

Code:
----------------------------------------------------------------
2009-04-20 18:06:05.914 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.3.1.4 - (561794): instance c013800d-0120-c4b4-d157-000002c0b100
on database directory <My Site Directory>/db in READ ONLY mode 

Database Class Loader started - derby.database.classpath=''

Does anyone know how to stop it from running in read only mode?

Cheers
Matt
 
Man of Honour
Joined
19 Oct 2002
Posts
29,524
Location
Surrey
I've used it a little but never come across a read only mode (not saying there isn't one). I suspect that the data files or the directory it is deployed in are read-only? Have you checked that file permissions have not been set incorrectly after installation?
 
Associate
OP
Joined
20 May 2007
Posts
441
It's weird cos I was using it and everything was fine and then it just suddenly came up with that.

I deleted the database and started again as there was very little information in it and luckily it has fixed itself. Do you think it could be a connection which wasn't closed by my server which then cause other connections to be read-only?

Thanks for your reply
Matt
 
Man of Honour
Joined
19 Oct 2002
Posts
29,524
Location
Surrey
Having searched a bit for this it seems you set the data.db to read-only to set it into read-only status. So I suspect this has happened inadvertedly. I don't think it is anything to do with leaving a connection open as this should be closed when the database is stopped.

Deby was originally created by a company called Cloudscape before being bought by Informix and then IBM. IBM released the source to Apache as Derby and still contribute to it. While it has no roots in common with IBM's enterprise level database DB2, I would still be surprised that something so simple as a connection left open would cause this kind of problem in a project contributed to by DB2's creators.
 
Associate
OP
Joined
20 May 2007
Posts
441
Ok cheers, ill try and find out a bit more about data.db because it seems that everything is ok when I use the database through a terminal but not when I try an access it via a website using a java class. (Im doing the site using JSP on a tomcat server).

So maybe im opening the database connection in read-only and its sticking or something, or tomcat is set to only read the database and not have write privilages.
 
Associate
OP
Joined
20 May 2007
Posts
441
Im running it on Ubuntu as for which mode I am not sure, I added it to tomcat and used the following :

driverClassName="org.apache.derby.jdbc.EmbeddedDriver"

in server.xml so im guessing its in Embedded mode.
 
Back
Top Bottom