Re: Some more profiling hotspots - Mailing list pgsql-jdbc

From j.random.programmer
Subject Re: Some more profiling hotspots
Date
Msg-id 20060824032516.61449.qmail@web32002.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Some more profiling hotspots  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Oliver:

Thanks for the quick followup !

I'm actually using a framework that I've developed,
which does
the standard O/R mapping from tables to java objects.

So if I have a table foo:

I automatically get:
  table_foo.java and
  table_fooMgr.java

The above is generated using via the framework
(internally using
JDBC meta data). This part is NOT profiled. Once the
classes
are generated, JDBC meta data is never used again.

So to actually run the profiled code, I say:
----------------------------------------------
Connection con = ....get connection....
for (int n = 0; n < 100000; n++)
  {
  table_foo prototype = new table_foo();
  prototype.set_column_a(1);
  prototype.set_column_b("2");
  List rows = table_fooMgr.getUsing(con, proto);
  }
-----------------------------------------

That's it in a nutshell. The actual stuff going over
the wire that
the getUsing(...) method above calls is a prepared
statement and
the query looks like:

SELECT column_a, column_b [...] from table_foo
WHERE column_a=1 and column_b='2' [...]

That prepared statement (and the JDBC driver code that
is called) is
what is really profiled under the covers. I know this
is still not very detailed. The only data fetched from
the database is via the
above query.

Unfortunately, it's hard to post the entire code
because there are dependencies on the framework etc.

I'm going to post a link to this framework (it's
really very cool, O/R, a
page templating language, many other cool things) when
I have it up
on the web. In the meantime, forgive my posting
incomplete info...but
at least this will give you a hint as to what's
getting profiled.

I'm running all this on:
  JDK 1.5.0_06
  postgres 8.1
  postgres 8.2dev-503 JDBC 3 driver.

Best regards,
--j



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

pgsql-jdbc by date:

Previous
From: till toenges
Date:
Subject: Re: Some more profiling hotspots
Next
From: Oliver Jowett
Date:
Subject: Re: Some simple JDBC profiling results