[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Decrypting error message
|
EclipseLink holds sessions and some of the artifacts we use to build sessions in
statics. It is possible your application is somehow affected by that.
I would expect the actual JPQLException to be thrown somewhere.
-Tom
Laird Nelson wrote:
Ah, now that would make sense. We have a JUnit test case that creates
entity managers in isolation: one for each provider (Hibernate,
EclipseLink, OpenJPA). These are done in as conscientious a manner as
possible. We have a parameterized test case that closes the
EntityManagerFactory if it's open, opens a new one, and asks it for a
new EntityManager and makes sure to feed the EntityManager the
persistence unit that is set up for that provider.
So first OpenJPA runs and does its thing, then we shut all the
infrastructure down. Then we fire up EclipseLink, shut everything down,
then Hibernate.
Perhaps there are statics or singletons or something lying around that
don't get "closed" effectively when we close the EclipseLink
EntityManagerFactory? Or something along those lines?
Best,
Laird
On Tue, Aug 9, 2011 at 3:32 PM, Tom Ware <tom.ware@xxxxxxxxxx
<mailto:tom.ware@xxxxxxxxxx>> wrote:
Hi Laird,
The only way I recreate this problem is to create an EntityManager
more than once. As a result, I am surprised you don't see something
logged earlier.
The way I see the problem is to write a persistence unit that
contains a named query with incorrect JPQL. I then deploy and use
an EntityManager. The use of that EntityManager fails with an
exception that tells me what is wrong with my JPQL. I then try to
use a new EntityManager based on the same persistence unit. This
time, I get the exception you describe.
If you are using EclipseLink 2.3 or later, you may be able to see
the actual issue by setting the persistence unit property
"eclipselink.deploy-on-__startup" to true. Otherwise, you may be
able to do something like what I have described above to see the
actual problem - make sure you set your logging to FINEST and you
have not turned off exception logging.
-Tom
Laird Nelson wrote:
On Tue, Aug 9, 2011 at 11:11 AM, Tom Ware <tom.ware@xxxxxxxxxx
<mailto:tom.ware@xxxxxxxxxx> <mailto:tom.ware@xxxxxxxxxx
<mailto:tom.ware@xxxxxxxxxx>>> wrote:
Where is the query defined? Annotations?
Yes, as a @NamedQuery.
Is it on an Entity?
An @Entity.
MappedSuperclass? Can you provide a snippet of how it is
defined and
include the annotations/XML that define the Entity itself?
Cut and paste (preserving whitespace):
@NamedQuery(name="Minor.__findAll", query="SELECT o FROM Minor o")
@Entity(name="Minor")
@Table(name="minor_table")
public class MinorEntity implements DateConstrained
{
@Id @Basic @Column(name="minor", length=4)
String minor;
@Basic @Column(name="txt", length=24)
String description;
@Basic @Column(name="cip_no", length=8)
String cipNumber;
@Temporal(TemporalType.DATE) @Column(name="active_date")
Date activeDate;
@Temporal(TemporalType.DATE) @Column(name="inactive_date")
Date inactiveDate;
Pretty basic stuff.
Also, I am still interested in what happens if you change
the name.
Nothing, reports the developer. She's also pointed out that
we've had the problem in the past, and that in point of fact it
is /not/ the query that is reported that is the problem. She's
said that she's had to comb through all our named queries
looking for one that is syntactically invalid. When she fixes
that error, then this phantom error goes away.
Best,
Laird
------------------------------__------------------------------__------------
_________________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx <mailto:eclipselink-users@xxxxxxxxxxx>
https://dev.eclipse.org/__mailman/listinfo/eclipselink-__users
<https://dev.eclipse.org/mailman/listinfo/eclipselink-users>
_________________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx <mailto:eclipselink-users@xxxxxxxxxxx>
https://dev.eclipse.org/__mailman/listinfo/eclipselink-__users
<https://dev.eclipse.org/mailman/listinfo/eclipselink-users>
------------------------------------------------------------------------
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users