Hi friends,
I am using stuts,oracle(st ored procedure),jsp in my application.
i have done all thing like writing stored procedure ,inserting data,validating data etc and finally data goes inside database.
But friends my problem is that when i do two simultanious transaction in aplication then both trasaction are inserted into databases without giving me any exception which i expect from second transaction.
for example
Suppose
I m login on two diffrent computers with same user id and doing following transactions simulteneously
Txn A giving payemnt 2000
Txn B also giving payemnt 2000
Now due to some business logic i m expecting only one transaction should be insert into DB & other should raise me my exception
My client not excepting Lock from start to end on data inserting stored procedure
Now my databses stored procedure not contain any lock contain only commits
how can i manage two independant transaction my application
Thanks
Amol
8 1678
The best solution for your problem is to implement locks.
u need to follow
1.LOCK
2.INSERT/UPDATE/DELTE
3.COMMIT/ROLLBACK
May i know what is the problem in implementing locks if that is your requirment.
The best solution for your problem is to implement locks.
u need to follow
1.LOCK
2.INSERT/UPDATE/DELTE
3.COMMIT/ROLLBACK
May i know what is the problem in implementing locks if that is your requirment.
Thanks debasisdas,
Thanks for ur help ..Would u plz tell me the syntax of lock on insert statement ..
and both my transaction are independent ..
So could u help me out ...
follow these stops
1.lock the table/s in exclusive mode
2.go for insert.
3.commit. (this unlock sthe table)
write all these in side the oracle procedure.
thanks ....please provide the syntex for loacking insert statement
suppose your table is inventory , then
1. lock table inventory in exclusive mode no wait;
2.insert into inventory values(v1,v2,v3 ,........);
3.commit;
Thanks ........for ur vital help
Hi
amoldiego
Welcome to TSDN.
You have reached the right place for knowledge shairing.
Here you will find a vast resource of related topics and code.
Feel free to post more doubts/questions in the forum.
But before that give a try from your side and if possible try to post what/how you have approached to solve the problem.
It will help Experts in the forum in solving/underestanding your problem in a better way.
Please follow the posting guidelines in every new post/reply.
please specify your post/question clearly.
Dont expect others to guess and solve your problem.
Suppose I created index on table . If i fired select statement on that table then how will come to know whether that index was fired or not ....
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Richard Maher |
last post by:
Hi,
I am seeking the help of volunteers to test some software that I've
developed which facilitates distributed two-phase commit transactions,
encompassing any resource manager (e.g. SQL/Server or Oracle) controlled by
Microsoft's Distributed Transaction Coordinator in a Windows2000
environment, with any resource manager under the control of DECdtm (e.g. Rdb
(or Oracle via the XA Veneer)) in a VMS environment.
|
by: Iain Mcleod |
last post by:
I wish to do a series of inserts on a sql server database in the context of
a transaction. The inserts will be done as a series of stored procedure
calls. I wish to be able to rollback any inserts should one fail.
A quick google on ".net transactions" and the following page comes up:
http://samples.gotdotnet.com/quickstart/aspplus/doc/mtstransactions.aspx
It says basically that the class System.EnterpriseServices.ContextUtil is
the...
|
by: Terri |
last post by:
I have a table called Transactions with 3 fields: ID, Date, and Amount. Each
ID can have multiple transactions in one particular year. An ID might not
have had any transactions in recent years.
For each ID I would like to sum all the transactions for the most recent
year in which one or more transactions have occurred.
Thanks for any help and for all previous help.
|
by: TD |
last post by:
I am trying to add transactions to my code. The original code worked
fine until I followed an example to setup transactions, now the code
does strange things, but no error messages.
Could someone please review my before and after code and tell me the
proper way to add transactions to my code?
Thanks,
TD
|
by: Mike P |
last post by:
I've been using C# transactions for a while and had no problems with
them. Using try catch blocks I can trap basically all possible errors
and rollback all necessary data.
Over the last few days I've been trying to convert some of this code to
SQL Server stored procedures, but it seems to lack many of the benefits
of C# transactions - a lot of the errors don't seem to be trapped by the
SQL error trapping (e.g. if I do an update on a row...
| |
by: mark |
last post by:
In Java, you can use JBoss or similar to host EJB that will manage your
transactions for you. You could, of course, write your own transactions
using JDBC.
In .NET, we can specify our own transactions using ADO.NET. Is there a
compatible tool within .NET to JBoss, where the transactions are managed for
you?
Thanks in advance.
Mark
|
by: radcaesar |
last post by:
Customer Table
ID Name Address City Phone
1 Vijay Stores 6,Gandhi Road Pondy 0413-276564
2 Ram Stores 3, MG Road, Pondicherry 0413-29543756
3 Balu Papers 3, RG St, Neyveli +919366228639
4 Senthil Papers 3, JN Road Cuddalore 04142-287654
6 TEst PRT PRT 246246
7 xxxx ggg eryyty drggd
|
by: Sridhar |
last post by:
Hi,
I am trying to implement sql transactions. But I am not knowing how to
do that. I created a data access layer which contains methods to
select/insert/update tables in a database. I have also created a business
logic layer to retrieve/update the data from the data access layer. All of
this is working fine if there are no transactions involved. If I need to use
transactions, I am not knowing how to do that. Lets say I have a webform...
|
by: Rami |
last post by:
I have some requirement for an automated payment system. The system has
four machines setup as follows:
1- Two machines have a clustered database.
2- Two machines have a .net business logic component that will handle
payment transactions with certain external component (Payment Gateway)
My query is regarding transaction handling inside the business logic
component. Because this component is running on two machines and these
two...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |