Help: way too many JDBC calls...
wtff Nov 6, 2003 9:57 AM
"wtff" wrote:"wtff" wrote:
Hello,
I got quite a big problem with CMP:
I switched the logging-level for org.jboss.ejb.plugins to DEBUG and noticed that
for fetching *one* cmp-record, jboss issues *several* queries, almost for every CMP field.
This cannot be true. I'm not a J2EE veteran but I cannot imagine that this can be right.
However, neither playing around with fetch-groups not with transaction settings
led to a better behaviour. Currently, the loading of one cmp-record takes 450 ms and
12 JDBC calls are being made. I included a shortend version of the logging output below.
As you can see, for fetching a cmp-bean with 22 fields, 12 SQL statements are being issued.
Ten of them are exactly the same.
I tested this with jboss 3.2.2 and 3.2.1 but both versions behave the same.
Please help. What I would expect to see is that there is one select statement for fetching the primary
key and one for fetching the cmp fields. My bean has no relationships and is as simple as it could be,
no fancy settings I tried out within jboss-cmp.xml or anything of that type...
greetings
Sascha
16:29:34,070 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.RepairRequest.findByPrimaryKey]
[org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:124)]
Executing SQL: SELECT id FROM repairrequest WHERE id=?
16:29:34,132 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.RepairRequest]
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:147)]
Executing SQL: SELECT pnr, mfr, kwd, ser, spc, flc, flh, tcc, rpo, red, rfr, reqcert, fixedrepcharge, exchoffer, warranty, ain, acn, ac_flc, ac_flh, sht, rdd, intfwd FROM repairrequest WHERE (id=?)
16:29:34,195 DEBUG // same text //
16:29:34,288 DEBUG // same text //
16:29:34,304 DEBUG // same text //
16:29:34,320 DEBUG // same text //
16:29:34,507 DEBUG // same text //
16:29:34,570 DEBUG // same text //
16:29:34,570 DEBUG // same text //
16:29:34,585 DEBUG // same text //
16:29:34,632 DEBUG // same text //
16:29:34,648 DEBUG // same text //
450 ms !!! for fetching ONE record