users@glassfish.java.net

Re: JPA Query finds wrong row?

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Thu, 06 Nov 2008 16:40:40 -0800

Markus,

What is the "o.designation" type? Do you create "x" on the client and pass it to
the server or create it on the server side?

thanks,
-marina

Markus Karg wrote:
> I have a totally weird problem with JPA, but it happens only in
> GlassFish while a standalone TopLink works well!
>
>
>
> In my session bean I am doing:
>
>
>
> Object o = *this*.em.createQuery("SELECT o FROM ManufacturingMethod o
> WHERE o.designation = ?1").setParameter(1, x).getSingleResult();
>
>
>
> It looks pretty simple and most of the time, it works correct.
>
>
>
> But sometimes the Object o that I am getting as a result has
> "o.designation" different to "x" (I am using overwritten .toString()
> method in the ManufacturingMethod class upon the returned Object o to
> proof this). WEIRD!
>
>
>
> Even more weird is: If a I am replacing variable x by a static String,
> then it is working totally correct all of the time!
>
>
>
> It actually looks like a bug of the JVM, but could that really be true...?!
>
>
>
> Can somebody explain what my failt is? Or is that a known GlassFish bug?
>
>
>
> Thanks!
>
> Markus
>
>
>
>
>
> QUIPSY QUALITY GmbH & Co. KG
>
> Ein Unternehmen der MES-Gruppe
>
> Stuttgarter Strasse 23
>
> D-75179 Pforzheim
>
> Tel: 07231-9189-52
>
> Fax: 07231-9189-59
>
> www.quipsy.de <http://www.quipsy.de>
>
> karg_at_quipsy.de <mailto:karg_at_quipsy.de>
>
> Registergericht Mannheim HRA 701214
>
> Geschäftsführer: Nils Schroeder
>
>
>
> Diese E-Mail enthält persönliche, vertrauliche und vor Weitergabe
> geschützte Informationen und ist ausschließlich für den vorgesehenen
> o.g. Empfänger (Adressaten) bestimmt. Falls Sie diese E-Mail
> versehentlich erhalten haben und nicht der vorgesehene Empfänger sind,
> bitten wir Sie, die E-Mail und deren Anhänge nicht aufzubewahren, nicht
> zu vervielfältigen, nicht zu nutzen und nicht weiterzugeben. Bitte
> informieren Sie uns als Absender über diesen Zustellungsfehler und
> löschen Sie die E-Mail.
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net