Page 1 of 1
Concurrency problem
Posted: Fri 20 May 2005 09:39
by samuel
Dear all,
Could anyone tell me how to make concurrent database application using ODAC?
Posted: Mon 23 May 2005 13:38
by Alex
It is hard to find out your exact need, if you mean multitier application then you can use our ProxySession demo, if it's a multithread application - Threads demo, in other case we need more detailed description of your problem.
Posted: Sat 18 Jun 2005 05:04
by Samuel
My problem is like this: My application will select and update the Oracle DB using ODAC. Many user can use my application at the same time. If two user edit the same record in the same time, there will be a conflict. How can I avoid this.
Posted: Mon 20 Jun 2005 13:14
by ThomasB
It depends totally on what you want to achieve. Get the books from Thomas Kyte, there is much info about this. Understand the concept of consistent reads.
Generally, if you want to avoid concurrent editing, your application has to open the data with FOR UPDATE NOWAIT. If another user tries to open the same data, he gets an ORA-00054. You can catch the error and convert it into a meaningful error message. Without the NOWAIT, the second session waits until the first transaction commits or rollbacks. If this lasts long, the second user may see the application "hang".
Posted: Tue 21 Jun 2005 07:41
by Alex
Take a look at "TOraDataSet.Lock" , "TOraDataSet.LockMode" and "TCustomOraQuery.SQLLock" ODAC help topics.