Hey,

ok I know that I'm brand new with your source, but can you please explain me, why the Log object is configuring the database in the open method of Log?

Shouldn't this code not be within the database class where you check all the other database properties?

Ok I've a first solution - I think very dirty.
I justed added a new property
filesreadonly=true

If this property is set added the following code in the Log.open()

if (pProperties.isPropertyTrue("readonly")) {
bReadOnly = true;

dDatabase.setReadOnly();

if (cCache != null) {
cCache.open(true);
}

reopenAllTextCaches();

bRestoring = true;

ScriptRunner.runScript(dDatabase, sFileScript, logType);

bRestoring = false;

return false;
}
// akede@users - patch Files readonly (e.G. on a CD)
if (pProperties.isPropertyTrue("filesreadonly")) {
bReadOnly = true; // The log should be read only

//dDatabase.setReadOnly(); // The database should be possible to be modified
if (cCache != null) {
cCache.open(true);
}

reopenAllTextCaches();

bRestoring = true;

ScriptRunner.runScript(dDatabase, sFileScript, logType);

bRestoring = false;

return false;
}
// end: patch akede

Cause the Log writer checks during the write if bReadOnly is true he will not try to write anything to the disc. And because the Log checks the bReadOnly on the close() too, there will also no script or cached file be written.

As I said above, it was for me a little bit confusing that a Log class is responsible for reading and writing the database and not the database class. So I was first confused why i worked till I understood that the Log.bReadOnly flag in the Log class only affects the files and not the database.bReadOnly only takes care about the statements and JDBC calls. If the database object would be asked for veryfing that scripts can be written or not, my patch won't work.

I'm looking forward to any comments.

Alex

PS: I changed also the HsqlDatabaseProperties.java but just to set the default value of filesreadonly to false.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hsqldb-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hsqldb-developers

Reply via email to