1. We are using Hibernate JPA with WebSphere 6.1 and are experiencing
serious bad performance. We are also seeing alot of "INFO
org.hibernate.util.NamingHelper.JNDI InitialContext properties:{}" in the
logs (as described in http://forum.hibernate.org/viewtopic.php?t=970086).

Our investigations shows that the logging statements come from
NamingHelper.getInitialContext().

Also, we can se that just creating an EntityManager from an
EntitManagerFactory results in 4 times InitialContext creation and 4 times
lookup of the WAS specific "java:comp/websphere/ExtendedJTATransaction".

A simple transaction results in 7-8 lookups !

By looking at a similar implementation in OpenJPA's
(openjpa-0.9.6-incubating) AutomaticManagedRuntime / WASManagedRuntime, it appears that OpenJPA only looks up the "extended transaction" object once,
and stores it in a static.

Stores in a static ? So what happens if you have more than one hibernate app running ?
Doesn't sound right.

/max


I've changed the WebSphereExtendedJTATransactionLookup so the innerclass
TransactionAdapter ctor does the lookup and stores the
extendedJTATransaction in a static in the
WebSphereExtendedJTATransactionLookup class.

This solves our performance problems.

Now, the WebSphereExtendedJTATransactionLookup class is not heavily
documented (...) so it is not obvious to us if this breaks something else.

2. NPE in
FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements

We have 2 Named queries (defined as annotions on the relavant entity) that
basically breaks the Hibernate JPA initialization, as a
NullPointerException is thrown in line 120 of
FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements().

I've taken the liberty to change the "direction" of the equals in the
if-statement, assuming that the "specifiedAlias" is never null.

This solves the NPE problem.

Please find attached the 2 modified files and don't flame me if I'm not
following procedures.

Kind regards

Jesper Udby
Freelance I/T Consultant




--
--
Max Rydahl Andersen
callto://max.rydahl.andersen

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss a division of Red Hat
[EMAIL PROTECTED]

_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to