Looking at the implementation of open() in DBDatabase, it does not look like 
this is thread save, because whichever thread happens to be last, wins in 
opening the database for its combination of DBDatabaseDriver and JDBC 
Connection.

Does this mean that in a typical WEB application each request needs it own 
DBDatabase object which, when not working with sessions needs to be created 
from scratch for each request?

As explained in the tutorial, I derive my db schema from DBDatabase and add the 
tables by creating them in the constructor. This is (a) non trival code and (b) 
always creates the exact same object again, so it seems a bit of a waste to 
perform the creation over and over again.

Clearly I am missing something. Is DBDatabase thread safe nevertheless?

Regards,
Harald.

Reply via email to