This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Suppose a thread opened a connection to a database and acquired an exclusive lock on a table to delete some rows.
What happens when a second thread tries to select a row from that locked table(or to update a row of the table) before the first one releases the lock by a commit or rollback?
Does it wait for the lock of the table to be released(namely,blocks?), does it throw an exception, or something else?
Thanks in advance...
The other threads wait (if serializable transaction for select or if insert or update) for determined amount of time unless the "nowait" is specified in the sql statement. Last, the transaction settings on the datasource and/or database will determine what type of operations will be possible when a row or table is locked. [ June 30, 2004: Message edited by: Brahim Bakayoko ]
SCJP, SCWCD, SCBCD, IBM CSD WebSphere v5, <br />A+, MCP 2000 and 2000 server, CST, and few incompleted certification tracks.<br /> <br />Ivory Coast<br /> <br />Analyze your web Request/Response @ <a href="http://webtools.servehttp.com" target="_blank" rel="nofollow">http://webtools.servehttp.com</a> down for a while...