Solved

- java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionTransact (GetOverLappedResult()).

Posted on 2001-06-08
5
289 Views
Last Modified: 2007-12-19
Could anybody know why this is happening? I'm currently running 2 process at the same time, each process will "insert" different data in a same table. how to avoid this, please advise. thanks.

I currently use JDBC:ODBC driver to connect to MS SQL Server.
0
Comment
Question by:waho
5 Comments
 
LVL 9

Accepted Solution

by:
Ovi earned 34 total points
ID: 6167178
You are using the same connection to the database ? If yes, Sugest to use different.
You are using the same statement? If yes, Sugest to use different.


... or post more data about what you are doing (some code will be nice)
0
 
LVL 35

Assisted Solution

by:TimYates
TimYates earned 33 total points
ID: 6167458
Or...if you are running two threads, make the function which writes to the database global to both, and synchronized

PS:  You have asked this question twice...please delete the other one...
0
 
LVL 9

Assisted Solution

by:mmuruganandam
mmuruganandam earned 33 total points
ID: 6167853
Hello waho,

   You have to do one thing with the connection object.

that is
You have to make the complete process into transactions.  If any problem occurs you have to roll back it.

Here is the sample code for you.

Say
Connection c = // get the connection;
c.setAutoCommit(false);
try
{
  Statement s = c.createStatement(SQLQuery);

  do the operations

  s.close();
  c.commit();
  c.close();
}
catch (SQLException e )
{
  if (c != null)
  {
    c.rollback();
    c.close();
  }
}


It will do the needful for you

Cheers,
Muru


0
 
LVL 1

Expert Comment

by:jimsims
ID: 6178321
both JDBC:ODBC driver and MS SQlserver suck.

get a real database and driver, and do as muru and timyates suggest - force synchronization through a singleton access class taht has the only connection open to the db
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9027457
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[split points between Ovi,TimYates and muruganandam]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question