Home » Developer & Programmer » Forms » locking problem when two users use the same form
locking problem when two users use the same form [message #462565] Fri, 25 June 2010 00:40 Go to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
A SINGLE FORM IN ORACLE 10G WE ARE USING POST KEWORDS IN THIS FORM IF TWO USERS WORKING ON THIS FORM ON SAME TIME LOCKING IS DONE HOW CAN WE SOLVE THIS PROBLEM SO THAT MULTIPLE USERS CAN WORKOUT ON THIS FORM

[MERGED by LF]

[Updated on: Tue, 29 June 2010 15:11] by Moderator

Report message to a moderator

Re: locking problem [message #462595 is a reply to message #462565] Fri, 25 June 2010 04:10 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
1) Don't post in caps
2) If the users are working on the same records you are going to get locking issues.
Re: locking problem [message #462613 is a reply to message #462565] Fri, 25 June 2010 04:44 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
SIR WHAT DO U MEAN BY POST NOT IN CAPS
& SECOND WHEN WE ADD RECORDS THEN POST KEWWORDS USED
Re: locking problem [message #462618 is a reply to message #462613] Fri, 25 June 2010 04:52 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Caps - capital letters.
You wrote this:
SIR WHAT DO U MEAN BY POST NOT IN CAPS
Should be:
Sir what do u mean by post not in caps.

All caps is generally considered shouting in the internet, don't do it.


Are the users trying to modify the same set of records?
Re: locking problem [message #462626 is a reply to message #462565] Fri, 25 June 2010 05:27 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
ok sir
locking when two userworking [message #462963 is a reply to message #462565] Mon, 28 June 2010 23:58 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
one form have a three data block when form open data fetch in master,detail & sub detail block through some condition

1. master form (no,date) composite primary key
2. detail block foreign key reference with above primary key
& have composite primary key on (no,date,product code & party id)
3. sub detail block linked with detail block through foreign key

when data fectch detail block have multiple records & sub detail block has also multiple records linked with detail block
& post keywords used otherwise message display
' do you want to save data or not'

problem is

when two users working on same form then form locked
first user primary key data saved (unt1-1,28-06-2010)
second user primary key data saved (unt2-1,28-6-2010)

why this problem created no is also diff on same time

please solved this problem


Re: locking when two userworking [message #462982 is a reply to message #462963] Tue, 29 June 2010 02:00 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Does this happen when you're inserting, updating or deleting?
Which block(s) do the locks occurs on?
Re: locking when two userworking [message #462991 is a reply to message #462963] Tue, 29 June 2010 02:16 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
when inserting data
sub detail block locked
system hang
but if second user closed the form then first user can working on this form
Re: locking when two userworking [message #463004 is a reply to message #462991] Tue, 29 June 2010 03:47 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
At what point does it hang?
When entering the form, querying data, navigating to one of the blocks, entering data?
Re: locking when two userworking [message #463008 is a reply to message #463004] Tue, 29 June 2010 05:23 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
master block --- single record

detail block --multiple record-- sub detail block

press button for sub detail block open

first time data fectch in three blocks

user press button & open sub detail block & check box appear user tick some data as per requirement & press ok to return back to main screen post keywords used in this ok button
where master & detail block shown

but if another user is also coming on in this main screen then first user when press ok button then system hang locking appear


Re: locking when two userworking [message #463012 is a reply to message #462963] Tue, 29 June 2010 06:20 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir pls give the solution its urgent
Re: locking when two userworking [message #463015 is a reply to message #463012] Tue, 29 June 2010 06:52 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
You do realise that everyone on this forum has a day job that's just as urgent as what you are doing?
You need to be patient - if you want immediate answers hire a consultant.

Are you sure the problem is on insert?
Because your last post indicates that sub block is pre-populated with data which the user updates by checking the checkbox.

Basically though this is due to some code you've written in the form. Forms default processing does not behave this way.
So you've got some code in some trigger that is locking a record and when another user runs the form that code tries to lock the same record the first user has.

You need to work out which trigger is being fired when the form hangs. Either run the form in debug mode or add messages to each trigger so you can see which one is being run when.

Once you've worked out which trigger is causing the lockup it should be fairly simple to work out what the problem really is.
Re: locking when two userworking [message #463019 is a reply to message #463015] Tue, 29 June 2010 07:00 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
ok sir i can try
Re: locking when two userworking [message #463139 is a reply to message #463019] Tue, 29 June 2010 15:14 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I didn't quite get it ... why do you POST changes? Why don't you COMMIT them? If you'd done that, locks would have been released.
Re: locking when two userworking [message #463167 is a reply to message #463139] Tue, 29 June 2010 23:35 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir post used because finally commit used on save button
before that data is inserting automatically & user update records as per requirement then post used if user do't want to save the data he used cancel button & exit form
Re: locking when two userworking [message #463304 is a reply to message #463167] Wed, 30 June 2010 11:06 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
OK; but, why POST? What does it do (in your case)? Is it necessary? Why wouldn't you simply COMMIT (on a "Save" button) or discard changes ("Cancel" button)? No POST at all.
Re: locking when two userworking [message #463656 is a reply to message #463304] Fri, 02 July 2010 07:52 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir in detail block 5 records exits &
in sub detail block also more records exists which is linked with detail block

f.e

first time form open & auto data fecth


master block

detail block sub detail block
(new canvas)

buff-00901 Clickutton 1(user select 1)
2
buff-00902 Click button 1(user select 1)
2
buff-00903 Click button 1
2(user select 2)
buff-00904 Click button 1(user select 1)
2
buff-00905 Click button 1(user select 1)
2

when we select first record buff-00901 & click button new canvas opend user select 1 means record updated then press ok & go back to main screen

then this time message shown do you want to save data or not so post word used to avoid this message

so that user select second record buff-00902 & run same process


Re: locking when two userworking [message #463698 is a reply to message #463656] Fri, 02 July 2010 11:29 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
click button new canvas opend user select 1 means record updated ...

What is on that "new canvas"? Why don't you update records on the "old canvas" (i.e. without navigating to another one)?
Re: locking when two userworking [message #463754 is a reply to message #463698] Sat, 03 July 2010 01:49 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir according to old example

detail block

buff-00901
buff-00902

sub detail block

new canvas multiple records exists like 50-60
user have to select somd data according to requirement
which is linked with detail block through primary foreign relations

buff-00901 1(user select 1)
2

buff-00902 1
2(user select 2)
i.e why we are using new canvas for selection data
Re: locking problem when two users use the same form [message #463780 is a reply to message #462565] Sat, 03 July 2010 06:50 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir i have debugg & find out the following problem

one user open the form data fetch auto primary key data (1,sysdate)

second user open the form data fetch auto primary key data
(2,sysdate)

first user press the button open new canvas some data allready in this block user updataed the data according to requirement after that press ok to return back to main screen

when press ok button post keywords used

second time choose another record press button open new canvas
& update some data after that when press ok cursor is stop on post keyword system hang

in between if second user close the form without any updation then cursor for first user go move

how can i solve this problem



Re: locking problem when two users use the same form [message #463924 is a reply to message #463780] Mon, 05 July 2010 04:14 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
It might be easiest if you attached the form because I'm struggling to understand what's happening.
Re: locking problem when two users use the same form [message #463949 is a reply to message #462565] Mon, 05 July 2010 06:51 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
design_ok button post creating problem
Re: locking problem when two users use the same form [message #463958 is a reply to message #463949] Mon, 05 July 2010 07:18 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Unfortunately I get an encoding error when I open your form so I can't read any of the triggers.
So can you give the following:
1) The full code of the WHEN-BUTTON-PRESSED trigger on design_ok
2) The full code of the WHEN-CHECKBOX-CHANGED on chk_design
3) Details of how the SALE_COMBINATION_SUB_DETAIL block is populated - I'm assuming you just use default query functionality.
4) Details of any insert/update/delete statements against the SALE_COMBINATION_SUB_DETAIL table in the form.
Re: locking problem when two users use the same form [message #463961 is a reply to message #463958] Mon, 05 July 2010 07:38 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
chk it
  • Attachment: CODE.txt
    (Size: 10.46KB, Downloaded 1059 times)
Re: locking problem when two users use the same form [message #463978 is a reply to message #463961] Mon, 05 July 2010 09:09 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
What are the primary keys of SALE_COMBINATION_DETAIL and SALE_COMBINATION_SUB_DETAIL?
Where are the procedures FILL_DETAIL and FILL_DESIGN_DETAIL called from?
Re: locking problem when two users use the same form [message #464037 is a reply to message #463978] Mon, 05 July 2010 23:55 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
1. What are the primary keys of SALE_COMBINATION_DETAIL and SALE_COMBINATION_SUB_DETAIL?
Where are the procedures FILL_DETAIL and FILL_DESIGN_DETAIL called from?

sale_combination_sub_detail.sale_comb_no = sale_combination_detail.sale_comb_no and
sale_combination_sub_detail.sale_comb_date = sale_combination_detail.sale_comb_date and
sale_combination_sub_detail.product_code = sale_combination_detail.product_code and
sale_combination_sub_detail.party_id = sale_combination_detail.party_id


2. Where are the procedures FILL_DETAIL and FILL_DESIGN_DETAIL called from?

canvas display
block control
push button(enter)
Re: locking problem when two users use the same form [message #464057 is a reply to message #464037] Tue, 06 July 2010 01:56 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
narang79 wrote on Tue, 06 July 2010 05:55
1. What are the primary keys of SALE_COMBINATION_DETAIL and SALE_COMBINATION_SUB_DETAIL?
Where are the procedures FILL_DETAIL and FILL_DESIGN_DETAIL called from?

sale_combination_sub_detail.sale_comb_no = sale_combination_detail.sale_comb_no and
sale_combination_sub_detail.sale_comb_date = sale_combination_detail.sale_comb_date and
sale_combination_sub_detail.product_code = sale_combination_detail.product_code and
sale_combination_sub_detail.party_id = sale_combination_detail.party_id



I asked for the primary keys of the tables not the relationship between them.
Re: locking problem when two users use the same form [message #464064 is a reply to message #464057] Tue, 06 July 2010 02:35 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir

1.What are the primary keys of SALE_COMBINATION_DETAIL and SALE_COMBINATION_SUB_DETAIL?


1.sale combination detail composite primary key
(sale_comb_no,sale_comb_date,product_code,party_id)

2. sale combination sub detail foreign key
(sale_comb_no,sale_comb_date,product_code,party_id)
Re: locking problem when two users use the same form [message #464075 is a reply to message #464064] Tue, 06 July 2010 03:32 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
They've got the same primary key? really?
That would mean you can only have one SALE_COMBINATION_SUB_DETAIL record for each SALE_COMBINATION_DETAIL record.
Are you sure that's right?
Re: locking problem when two users use the same form [message #464091 is a reply to message #462565] Tue, 06 July 2010 04:19 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member


1.sale combination detail composite primary key
(sale_comb_no,sale_comb_date,product_code,party_id)

2. sale combination sub detail foreign key
(sale_comb_no,sale_comb_date,product_code,party_id)

sir as per above sale combination detail is primary key
& sale combination sub detail is foreign key

in sale combination sub detail form user can select mulitiple records party_id is differ in each case which is linked with sale combination detail block
Re: locking problem when two users use the same form [message #464096 is a reply to message #464091] Tue, 06 July 2010 04:24 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
run the following sql and post the results:
SELECT uc.table_name, uc.constraint_type, uc.constraint_name, ucc.column_name 
FROM user_constraints uc, user_cons_columns ucc
WHERE uc.constraint_name = ucc.constraint_name
AND uc.constraint_type IN ('P', 'U')
AND uc.table_name IN ('SALE_COMBINATION_DETAIL', 'SALE_COMBINATION_SUB_DETAIL')
ORDER BY 1,2,3;
Re: locking problem when two users use the same form [message #464097 is a reply to message #464096] Tue, 06 July 2010 04:29 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
table_name c constraint_name column_name
------------------------------ - ------------------------------ ----------------
sale_combination_detail p pk_sale_comb_de sale_comb_no
sale_combination_detail p pk_sale_comb_de product_code
sale_combination_detail p pk_sale_comb_de party_id
sale_combination_detail p pk_sale_comb_de sale_comb_date
Re: locking problem when two users use the same form [message #464101 is a reply to message #464097] Tue, 06 July 2010 04:34 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
If that's correct then SALE_COMBINATION_SUB_DETAIL doesn't have a primary key.
Re: locking problem when two users use the same form [message #464104 is a reply to message #464101] Tue, 06 July 2010 04:43 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
yes sir SALE_COMBINATION_SUB_DETAIL doesn't have a primary key.

it is a foreign key reference with primary key of sale combination detail table
Re: locking problem when two users use the same form [message #464119 is a reply to message #464104] Tue, 06 July 2010 06:08 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why didn't you just say so?

Can we confirm if it the post command is causing the hang or something else in that trigger?
If you haven't already put messages in that trigger before and after the post command, one inside the loop, one before the hide view command and one at the very end.
Let me know which message is the last one you get before it hangs.

Also you said this:
Quote:

one user open the form data fetch auto primary key data (1,sysdate)

Which tables primary key and which columns?

Are there any database triggers on either of the tables:
select trigger_name, trigger_type, triggering_event, table_name from user_triggers where table_name in ('SALE_COMBINATION_DETAIL', 'SALE_COMBINATION_SUB_DETAIL')


I'm really confused by your design. Why does SALE_COMBINATION_SUB_DETAIL not have primary key?
Why are you populating blocks using cursors?
Re: locking problem when two users use the same form [message #464128 is a reply to message #464119] Tue, 06 July 2010 06:57 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
three tables used in this form

1. sale_combination_master
one user open the form data fetch auto primary key data primary key (sale_comb_no,sale_comb_date)(1,sysdate)


2. sale combination detail
primary key (sale_comb_no,sale_comb_date,product_code,party_id)
(1,sysdate,'0001','buff-00901')
foreign key (sale_comb_no,sale_comb_date) relation with sale
(1,sysdate)
combination master table

3. sale combination sub detail
foreign key (sale_comb_no,sale_comb_date,product_code,party_id)
relation with sale combination detail table
(1,sysdate,'0001','buff-00901')


first time when first user open new block (sale combination sub detail) & tick some data as per requirement press ok to return back to main screen then no problem

after that choose next record in sale combination detail & press button to again open sale combination sub detail block then tick some data as per requirement & press ok then on post keyword system hang

if in between second user close the form then for first user
system can work & cursor move from post keyword

no database trigger used


Re: locking problem when two users use the same form [message #464185 is a reply to message #464128] Tue, 06 July 2010 11:08 Go to previous messageGo to next message
mikerault
Messages: 21
Registered: June 2010
Location: Alpharetta, Ga
Junior Member
Have you indexed the foreign keys? If not you will get excessive locking.

Mike
Re: locking problem when two users use the same form [message #464212 is a reply to message #464185] Tue, 06 July 2010 23:39 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir can u please explan about indexing
and how it will get excessive locking.
Re: locking problem when two users use the same form [message #464213 is a reply to message #464212] Tue, 06 July 2010 23:45 Go to previous messageGo to next message
mikerault
Messages: 21
Registered: June 2010
Location: Alpharetta, Ga
Junior Member
If the foreign key is not indexed then the table is used for verification, when it is indexed then the index is used and no locking is caused.
Re: locking problem when two users use the same form [message #464215 is a reply to message #464213] Wed, 07 July 2010 00:13 Go to previous messageGo to previous message
narang79
Messages: 137
Registered: June 2010
Senior Member
can u pls give the statement of indexing
so that i will try
Previous Topic: Forms 11g Can not create Data Block ?
Next Topic: Copy and open Command in Oracle 10g Linux (Minut, Ubuntu)
Goto Forum:
  


Current Time: Fri Sep 20 04:28:21 CDT 2024