?
Solved

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

Posted on 2001-06-08
5
Medium Priority
?
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
Ovi earned 136 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 132 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 132 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

764 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