It seems that you are getting duplicate data in collection.

Try using java.util.Set for Collection. 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Jon
Haugsand
Sent: Monday, September 23, 2002 3:07 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Serious problem with wrong data returned.


We have a serious problem with JBoss 3.0.1 that I guess is not easy to
reproduce or else it should have been reported long time ago.  I post
here so that I can get help to identify where the problem really is.
My (BA devoted) collegue thinks it _is_ a problem with JBoss, but if
so, it should be corrected quite soon...

The following is a snapshot of a Cactus test:

    public void testberegnSikkerhet() throws Exception{
        final Collection c = ff.findAlleKunder();
        for( final Iterator i = c.iterator(); i.hasNext(); ) {
            final KundeLocal kunde = (KundeLocal) i.next();
            cat.debug( "kunde.pk=" + kunde.getPrimaryKey() );
            cat.debug( "kunde.foretaks=" + kunde.getForetaksnr() );
            cat.debug( "kunde.data=" + kunde.getData() );
            kunde.beregnSikkerhet( null, true );
        }
    }

The above getters are what is standard CMP 2.x and it is without doubt
wrong data that is written out:

   kunde.pk=[.1.]   kunde.foretaks=999999999
   kunde.pk=[.2.]   kunde.foretaks=999999999

In reality, the KUNDE table's FORETAKS should contain something very
different in both cases.  (FORETAKS is what was found in the last
entry of the table.)

Please help us to solve the problem.  (We use Oracle with
driver oracle.jdbc.driver.OracleDriver if it is interesting.)

------------------------------------------------------
More output below:

2002-09-23 11:01:12,115 DEBUG
[norgesbank.bank.sil.entiteter.kunde.KundeTest] kunde.pk=[.1.]
2002-09-23 11:01:12,119 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Kunde] Executing
SQL: SELECT foretaksnr, bere
2002-09-23 11:01:12,155 DEBUG
[norgesbank.bank.sil.entiteter.kunde.KundeTest] kunde.foretaks=999999999
2002-09-23 11:01:12,159 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Kunde] Executing
SQL: SELECT foretaksnr, bere
2002-09-23 11:01:12,187 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.Foretak.findByForetaksnr]
Executing SQL: SELECT t0_f
2002-09-23 11:01:12,208 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Foretak] Executing
SQL: SELECT foretaksNr, NA
2002-09-23 11:01:12,232 DEBUG
[norgesbank.bank.sil.entiteter.kunde.KundeTest]
kunde.data={foretaksnr=999999999 beregnetSikkerhet=
2002-09-23 11:01:12,237 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Kunde] Executing
SQL: SELECT foretaksnr, bere
2002-09-23 11:01:12,259 DEBUG
[norgesbank.bank.sil.entiteter.kunde.KundeBean] beregnSikkerhet()
2002-09-23 11:01:12,263 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.Pant.findPantForKunde]
Executing SQL: SELECT t0_p.id
2002-09-23 11:01:12,280 DEBUG
[norgesbank.bank.sil.entiteter.kunde.KundeBean] beregnSikkerhet(): Fant
0 pant for kunde 999999999.
2002-09-23 11:01:12,280 DEBUG
[norgesbank.bank.sil.entiteter.kunde.KundeBean] beregnSikkerhet()={NOK=0
Utl=0}
2002-09-23 11:01:12,283 DEBUG
[norgesbank.bank.sil.entiteter.kunde.KundeTest] kunde.pk=[.2.]
2002-09-23 11:01:12,287 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Kunde] Executing
SQL: SELECT foretaksnr, bere
2002-09-23 11:01:12,326 DEBUG
[norgesbank.bank.sil.entiteter.kunde.KundeTest] kunde.foretaks=999999999
2002-09-23 11:01:12,332 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Kunde] Executing
SQL: SELECT foretaksnr, bere



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to