Solved

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

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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 …
Suggested Courses

738 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