Solved

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

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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Which non-HTML GUI front end to use with Java? 3 50
Notify sent to other threads in Java 9 41
hashmap order 17 40
Java List 4 31
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…
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

685 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