Solved

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

Posted on 2001-06-08
5
284 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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 how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

709 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now