Hey there,


I’m relatively new to Derby, but I’m very familiar with Relational Database Management Systems (RDMS) in general.  If Apache created a database engine that didn’t allow for mutli-threaded access to the database, it’d be a serious black eye for all the developers involved.  You will need to use transactions to make multiple statements atomic, but for simple select statements for example, you can rest assured that if one thread begins modifying a row just before you select, your select will be blocked until the update is complete.  If you find that that is not the case, I’m sure the Derby development team would be interested in hearing bout your problem.





From: Brandon Dohman [mailto:B-Dohman@gotcg.net]
Sent: Thursday, April 17, 2008 1:03 PM
To: Derby Discussion
Subject: threads and derby


I’ve currently created a multithreaded server that is using 1 class to do all of the database interactions when receiving commands from the client programs.


My question:  When my server code has multiple threads going, will the database, or the java code for that matter, wait until the current threads transactions are done before allowing another thread to take control of the database?


I have created a simple user login system that allows access to a machine, and there will be possible multiple logins going on at the same time (very possible it will never happen at the exact same time) but along with logins, admin users will be updating information in the database.  And I just want to make sure I won’t crash my database, if I have operations trying to access things at the same time.




No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008 9:34 AM