Home » Developer & Programmer » Forms » how to release lock (form 6i,database 9i,xp)
how to release lock [message #359443] Sun, 16 November 2008 04:57 Go to next message
hisham99
Messages: 106
Registered: October 2008
Location: united arab emirates
Senior Member
i have invoice application in form 6i,at the end of the day i should post the invoice to client file , my problem is
some time other user will open the client file,or even invoice file and keep it open for long time so if i try to post the invoice my program will hang ,but when they exit my program will run fast .
also i have other problem which i ask many people they said its normal but i hope if i can find any solution
if two user are open the same record ,and one of them try to update that record message will appear (could not reserve record(2 tries).keep trying)
can any one show me how i can let both user do there job at same time
Re: how to release lock [message #359455 is a reply to message #359443] Sun, 16 November 2008 10:44 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell, you can not. Two (or more) users can not modify the same record at the same time. Oracle Concepts book, Locking mechanisms.
Re: how to release lock [message #359494 is a reply to message #359455] Sun, 16 November 2008 21:40 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
This problem occurred at one facility for which I did work. Our solution was to update the record with the userid of the person who was about to change it, commit this change, and then permit them to make their modifications. When they were finished we removed their userid from the record. With this information in the record, when someone else went to update it, the form would look to see if the column was 'null' or not, and if not, an 'alert' would be displayed saying who had this record open in their form.

David
Re: how to release lock [message #359500 is a reply to message #359494] Sun, 16 November 2008 23:24 Go to previous messageGo to next message
hisham99
Messages: 106
Registered: October 2008
Location: united arab emirates
Senior Member
can you show me how to do this please ,step by step
and i want you to know that user will post more than one record at a time
for example if he have invoice from no 1 to 20 he can post all of them at one time
Re: how to release lock [message #359506 is a reply to message #359500] Mon, 17 November 2008 00:03 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
To use my idea you would need to change the query facility so that it updates each of the records that are currently NOT being updated by anyone else and you either display an alert for a record that is being used or display on the screen who currently has the record assigned to their userid. You could also use the 'set_item_instance_property' to change the colour of a 'locked' record.

You will have to create a script to turn set all records to be 'available' by setting their 'being_updated_by' column to 'null'.

David
Re: how to release lock [message #359512 is a reply to message #359443] Mon, 17 November 2008 00:26 Go to previous messageGo to next message
hisham99
Messages: 106
Registered: October 2008
Location: united arab emirates
Senior Member
can you please show me an example of that script on emp table thanks for your help
Re: how to release lock [message #359681 is a reply to message #359512] Tue, 18 November 2008 00:20 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
"update emp set userid = null where userid is not null;"

David
Previous Topic: Oracle Application Server et al (merged)
Next Topic: Closing child window
Goto Forum:
  


Current Time: Mon Feb 03 15:04:01 CST 2025