Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicate records getting inserted

Status
Not open for further replies.

selani

Programmer
Apr 30, 2003
35
IN
Hi all,
we are encountering this strange issue of duplicate records getting inserted into the database.
The application works as below:
The transaction is initiated by the user, it goes to IPlanet server, and via plug-in is given to servlet running in weblogic server. The servlet inserts the record into Oracle database.For unknown reasons, for few transations the duplicate transactions are getting inserted into the database, that is, 3 records are inserted instead of 1 record.
Has anyone come across similar scenarios?Could you give us clues on resolving this.

Thank you in advance.

 
You need to either make your insertion code thread safe, so that only one thread can access the db to to the insert, or do something similar db side (ie locking the tables and rejecting inserts for same data).

--------------------------------------------------
Free Database Connection Pooling Software
 
Hi all,
We hv sorted out the issue.
It was all the b'cos of the Plugin:

The plug-in sends the request to the servlet in weblogic server. When no response is received from the weblogic,by default, the plug-in send a repeat request. The number of repeat reqs is = ConnectTimeOutSecs/ConnectRetrySecs (both the values are maintained in obj.conf file), before giving "503/Service Unavailable" response to the client.
In our case, as the response was not received from weblogic server, and eventually plug-in initiated req leading to mutliple insertion of records.

We hv changed the values of ConnectTimeOutSecs & ConnectRetrySecs such that ConnectTimeOutSecs/ConnectRetrySecs is 0.

This has resolved the problem.
 
Don't take this the wrong way, but that sounds a bit of a "hacky" solution. I would try to implement a safer way of controlling such problems.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top