----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
> I can execute the same code from a different driver class (as opposed to
> servlet) that I can run from the command line and everything executes
> quickly.
> The same code under JServ takes a loooong time to execute and results in
the
> following exception (from the log file):
They take a long time because of an unrelated problem to JServ...
-- I thought it was the problem with Oracle's JDBC drivers, but then I tried
the same code outside Apache/JServ env. and it worked.
> Tue May 16 12:34:44 EDT 2000: SQL: SELECT COUNT(H.harvest_id) FROM
> nm_harvest H WHERE H.user_id=21 AND H.deleted='N' AND H.harvest_type='foo'
>
> Tue May 16 12:35:04 EDT 2000: Caught current thread not owner
> java.lang.IllegalMonitorStateException: current thread not owner
> at
Ok, that exception makes me think that you have some sort of thread
contention problem in your code. Without seeing your code, I'm not going to
try to guess the problem though. You might also want to make sure that you
are using the latest version of Oracle JDBC drivers. They are well known to
be very buggy.
-- OK, my code is included. I don't use any threads in my code.
You should also look into the threading of your JVM. You are using an old
version of the blackdown JVM. It could be a problem with that. Try switching
JVM's and seeing if the problem goes away.
-- I'll try a newer one, although if this were a JVM issue then the same
code wouldn't work from the command line either, no?
> Could there be something in JServ that triggers this exception....and
makes
> the execution of some JDBC methods super slow?
Actually, now that you mention it, we specifically wrote code to check to
see if anyone from neomeo.com was doing a JDBC call and then we purposely
slowed it down and also attempt to cause some Oracle code to throw an
exception. :-)
-- :)
Post your code that demonstrates this problem. I would guess that you are
using a class variable somewhere that isn't synchronized or it is a JVM
problem.
-- I am using some class variables, but I'm not using threads at all, so I
don't think here is any 'on-toe stepping'.
Here's the method where the exception gets thrown:
protected ResultSet executeNonModQuery(String sql)
{
ResultSet rs = null;
try
{
log("SQL: " + sql);
this.conn = getConnection();
this.stmt = conn.createStatement();
rs = this.stmt.executeQuery(sql);
}
catch (IllegalMonitorStateException imse)
{
log(imse, "Caught current thread not owner");
log("CURR THREAD: " + Thread.currentThread());
}
catch (Exception e)
{
log(e, "karamba!");
}
finally
{
return rs;
}
}
The caller of this method calls another method that does this.conn.close()
and this.stmt.close().
All calls to this method are sequential.
This method is used for all SELECT statements in my code. There are some
queries that all of a sudden stop working and once they stop working they
never work again :)
Thanks,
Otis
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]