Home » SQL & PL/SQL » SQL & PL/SQL » FOR UPDATE OF not working (oracle 10g)
FOR UPDATE OF not working [message #626685] Fri, 31 October 2014 01:19 Go to next message
vivek_rol
Messages: 65
Registered: February 2009
Member
hi all,
we have online transaction processing setup
front end is java and backend is oracle 10g.

through java web we are passing transactions into oracle database. transactions are credit and debit.

we have table name as customer balance whose column structure is

transaction_date current_balance


through front end we are processing data into database through xml.we have procedures which captures this data
and insert or update into db


some time its is observed that whenwhere we pass 2 credit entries with same data of transactions, the customer
account is credited with only one entry.

we have used FOR UPDATE OF clause , but still the problem is there .
we also used COMMIT propery.

we are wondering why its happening in oracle . why oracle is not processing two transactions
with same date of transaction one by one? why it process only one transaction?

regards
vivek


Edited by Lalit : Removed superfluous lines in the end

[Updated on: Fri, 31 October 2014 01:40] by Moderator

Report message to a moderator

Re: FOR UPDATE OF not working [message #626687 is a reply to message #626685] Fri, 31 October 2014 01:47 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

If all is used properly then there is no problem.
You have problem, so code is wrong.

First client/server or n-tiers application?

Re: FOR UPDATE OF not working [message #626689 is a reply to message #626687] Fri, 31 October 2014 01:49 Go to previous messageGo to next message
vivek_rol
Messages: 65
Registered: February 2009
Member
if we are passing 2 transactions with different date then its updating properly
Re: FOR UPDATE OF not working [message #626690 is a reply to message #626689] Fri, 31 October 2014 01:50 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This does not change anything to my answer.

Re: FOR UPDATE OF not working [message #626691 is a reply to message #626689] Fri, 31 October 2014 01:51 Go to previous messageGo to next message
vivek_rol
Messages: 65
Registered: February 2009
Member
client/server
Re: FOR UPDATE OF not working [message #626692 is a reply to message #626685] Fri, 31 October 2014 01:53 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
vivek_rol wrote on Fri, 31 October 2014 11:49

some time its is observed that whenwhere we pass 2 credit entries with same data of transactions, the customer
account is credited with only one entry.

we have used FOR UPDATE OF clause , but still the problem is there .
we also used COMMIT propery.


It means the select for update picks only one entry. You can execute the select for update for those entries in SQL*Plus and verify how many actual rows are selected. Can you please post a test case.
Re: FOR UPDATE OF not working [message #626693 is a reply to message #626691] Fri, 31 October 2014 01:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

OK, but code is wrong and you posted nothing about it but your feeling it is correct, so we can't help in any way.

Re: FOR UPDATE OF not working [message #626694 is a reply to message #626693] Fri, 31 October 2014 01:59 Go to previous messageGo to next message
vivek_rol
Messages: 65
Registered: February 2009
Member
thanks lalit. i will revert u
Re: FOR UPDATE OF not working [message #626695 is a reply to message #626694] Fri, 31 October 2014 02:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

What do you mean by "we also used COMMIT propery"?

Re: FOR UPDATE OF not working [message #626696 is a reply to message #626694] Fri, 31 October 2014 02:41 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
vivek_rol wrote on Fri, 31 October 2014 07:59
thanks lalit. i will revert u


Are you sure?
I have checked your 10 latest topics, you didn't thank nor even feedback to people that helped you.
Are you the kind of person who ask, ask, ask, take, take, take and never give anything not even the slightest "thank"?
Are you the kind of person who considers others as their servants that do not deserve a single sight of respect?

Re: FOR UPDATE OF not working [message #626697 is a reply to message #626692] Fri, 31 October 2014 03:37 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Lalit Kumar B wrote on Fri, 31 October 2014 06:53


It means the select for update picks only one entry.


Looking at the OPs description I doubt it.
Sounds like they're getting 2 inputs to update the same target row and one of the inputs is being ignored. Select for update would be run against the target.
Re: FOR UPDATE OF not working [message #626698 is a reply to message #626697] Fri, 31 October 2014 04:29 Go to previous messageGo to next message
vivek_rol
Messages: 65
Registered: February 2009
Member
Thanks lot lalit

Mnay thanks to MR.CADOT

regards
vivek
Re: FOR UPDATE OF not working [message #626699 is a reply to message #626698] Fri, 31 October 2014 04:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
Thanks lot lalit


For what?
What was the problem (if you solved it)?

Re: FOR UPDATE OF not working [message #626714 is a reply to message #626698] Fri, 31 October 2014 10:23 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
vivek_rol wrote on Fri, 31 October 2014 14:59
Thanks lot lalit

Mnay thanks to MR.CADOT


You did not understand Michel's suggestion. It is not about just a thank you. Per forum etiquettes, you are expected to provide a proper feedback like what you tried based on the suggestions given to you. And, finally post what actually worked for you. Even better if you let the people know why their sugestion did not work for you.

It ensures everybody looking at the thread that the topic is completely answered and that it is closed.

Hope to see you follow it in future Smile
Re: FOR UPDATE OF not working [message #626717 is a reply to message #626714] Fri, 31 October 2014 11:01 Go to previous message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

... and my "suggestion" is to act like and be a nice and fair human being.

Previous Topic: Transforming rows to colums
Next Topic: Please clarify the LOCK doubts
Goto Forum:
  


Current Time: Sat Apr 27 00:13:49 CDT 2024