wcleung9
04-02-2003, 04:28 AM
Two questions:
1. I am writing a web application. I wonder if the following scenario is possible?
First, page1.jsp connect to DB, select some rows and lock them up, disconnect, forward clients to page2.jsp.
Then, page2.jsp connect to DB, update those rows and release the lock, disconnect.
The only locking method method I know is "select ....for update". But it seems not applicable. Is there any other locking method in Oracle that can fit my situation?
2. For "select.....for update", if my connection to DB is somehow lost before I can "commit" to release the lock, will the rows/tables be locked up forever? I read from other topics that there is a parameter called "sqlnet.timout" to set at server to prevent permanent locking. But I am not a DBA and hence cannot modify any server-setting. So is there any thing I can do in my application to set a timeout mechanism?
1. I am writing a web application. I wonder if the following scenario is possible?
First, page1.jsp connect to DB, select some rows and lock them up, disconnect, forward clients to page2.jsp.
Then, page2.jsp connect to DB, update those rows and release the lock, disconnect.
The only locking method method I know is "select ....for update". But it seems not applicable. Is there any other locking method in Oracle that can fit my situation?
2. For "select.....for update", if my connection to DB is somehow lost before I can "commit" to release the lock, will the rows/tables be locked up forever? I read from other topics that there is a parameter called "sqlnet.timout" to set at server to prevent permanent locking. But I am not a DBA and hence cannot modify any server-setting. So is there any thing I can do in my application to set a timeout mechanism?