2 Replies Latest reply on Jun 8, 2004 2:17 AM by Sven Baumgarten

    to many sql statements in JBoss3.2.4

    Sven Baumgarten Newbie

      Hi,

      I've been logging sql statements on jboss 3.2.4. Every of my entity beans has an getDTO (DTO = DataTransferObject) method that builds an DTO by getting all attributes of the entity bean. JBoss does for each get a separate SELECT statement:

      2004-06-07 11:32:56,329 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AngebotPos] Executing SQL: SELECT ID, PosNr FROM AngebotPos WHERE (ID=?) OR (ID=?)
      2004-06-07 11:32:56,345 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AngebotPos] Executing SQL: SELECT ID, Baustein FROM AngebotPos WHERE (ID=?) OR (ID=?)
      2004-06-07 11:32:56,345 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AngebotPos] Executing SQL: SELECT ID, ArtikelNr FROM AngebotPos WHERE (ID=?) OR (ID=?)
      2004-06-07 11:32:56,345 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AngebotPos] Executing SQL: SELECT ID, Bezeichnung FROM AngebotPos WHERE (ID=?) OR (ID=?)
      2004-06-07 11:32:56,345 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AngebotPos] Executing SQL: SELECT ID, Menge FROM AngebotPos WHERE (ID=?) OR (ID=?)
      2004-06-07 11:32:56,345 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AngebotPos] Executing SQL: SELECT ID, Einheit FROM AngebotPos WHERE (ID=?) OR (ID=?)
      2004-06-07 11:32:56,360 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AngebotPos] Executing SQL: SELECT ID, Preis FROM AngebotPos WHERE (ID=?) OR (ID=?)

      ...

      In JBoss3.2.3 only one SELECT for all attributes of the entity was created:

      2004-06-07 11:46:38,766 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AngebotPos] Executing SQL: SELECT ID, PosNr, Baustein, ArtikelNr, Bezeichnung, Menge, Einheit, Preis, PreisBasis, Rabatt, Gesamtpreis, BetragHW, keinPreis, keinRabatt, Provision, Langtext, Umbruch, AbsatzTrennung, TextUebernahme, Schlusstext, ArtikelNrKunde, Kostenstelle_Nr, Sachkonto_Nr, MwStSatz, sysVersion, TextPosNr, Liefertermin, KW, DLZ, Auftragmenge, offAuftragmenge, EndAuftragKZ, AgPosZusatz_ID FROM AngebotPos WHERE (ID=?) OR (ID=?)

      Is this a bug or a new feature? I think one SELECT for all attributes would be faster?!

      regard Sven