Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / November 2005

Tip: Looking for answers? Try searching our database.

executeUpdate takes forever

Thread view: 
rouble@gmail.com - 30 Nov 2005 07:09 GMT
Hi All,

If I do the following:

           String cmd = "INSERT INTO Orders(Id, CompilationTitle,
Template, PurchaseDate, RecievedPayment, CompilationDate, TotalCost,
TotalLength, Customer_Id) VALUES(Orders_sequence.nextval, ";

           cmd += "'" + cl.getOptionValue("title") + "', '" +
cl.getOptionValue("template") + "', NULL, 'N', SYSDATE, 0.00, 0, " +
cl.getOptionValue("customerId") + ")";

           // run the command
           System.out.println(cmd);
           stmt.executeUpdate(cmd);

... it takes forever (over 10 minutes). Is there anyway I can debug
this to see what is going on ?

If I run the exact same command on the SQL prompt it takes it
*instantaneously*. Am I missing something ?

Cheers
rouble
Joe Weinstein - 30 Nov 2005 16:38 GMT
> Hi All,
>
[quoted text clipped - 20 lines]
> Cheers
> rouble

Just show us the actual final string you're sending. I assume the time
is all taken in the executeUpdate() call. The way to debug it is to
set the oracle session to print out the query plan. Then compare the
query plan for the SQL-PLUS session to the JDBC one.
   Is the JDBC client running from the same machine as the SQL-PLUS
client? Which JDBC driver are you using?

Joe Weinstein at BEA Systems
rouble@gmail.com - 30 Nov 2005 18:09 GMT
Hi Joe,

Thanks for the response. Please read inline.

> > Hi All,
> >
[quoted text clipped - 22 lines]
>
> Just show us the actual final string you're sending.

Here is the string:
"INSERT INTO Orders(Id, CompilationTitle, Template, PurchaseDate,
RecievedPayment, CompilationDate, TotalCost, TotalLength, Customer_Id)
VALUES(Orders_sequence.nextval, 'Best of BEP', 'Flying Notes', NULL,
'N', SYSDATE, 0.00, 0, 1)"

> I assume the time  is all taken in the executeUpdate() call.

Yes, as far as I can tell.

> The way to debug it is to set the oracle session to print out the query plan. Then compare the
> query plan for the SQL-PLUS session to the JDBC one.

How do I do this ? I am new to the db arena.

> Is the JDBC client running from the same machine as the SQL-PLUS
> client?

Yes.

> Which JDBC driver are you using?

I tried:

oracle.jdbc.OracleDriver and
oracle.jdbc.driver.OracleDriver

Cheers
rouble

> Joe Weinstein at BEA Systems
Joe Weinstein - 30 Nov 2005 18:33 GMT
> Hi Joe,
>
[quoted text clipped - 41 lines]
>
> How do I do this ? I am new to the db arena.

You're going to have to ask for help from your DBA. As far
as I know, the query plans are printed out at the DBMS.
Joe

>>Is the JDBC client running from the same machine as the SQL-PLUS
>>client?
[quoted text clipped - 12 lines]
>
>>Joe Weinstein at BEA Systems


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.