On Friday 31 August 2007 01:27:24 am De Silva Jayasinghe, Robin wrote:
Hi Steve!
> We are aware that the Hibernate SessionFactory attempts to obtain a
> Connection during its construction in order to query the JDBC metadata,
> yes.
>
> I think you may be slightly confused (it seems that way to me anyway).
> The connection obtained during construction of a SessionFactory has
> absolutely nothing to do with the connections used by sessions.
I accept the fact that the connection obtained by SessionFactory is in no
relation to the one used by the Session. However, Table 2 in chapter 4.5.2
of "EJB 3.0 Core Contracts and Requirements" states that during dependency
injection in a SLSB the access to ResourceManager is not allowed. We
interpret this part of the spec in a way that a SLSB is not allowed to
access to any resources (including datasources). Of course we accept the
fact that you might interpret the spec in a different way. I only want to
raise some awareness that Hibernate in its current state does not run as
smooth as it could on Netweaver.
Best Regards,
Robin
--
AFAICT, this is caused by your (atypical) decision to create the
SessionFactory (EntityManagerFactory) upon first injection. If the
SessionFactory were created up front at app start-up (which is by far more
typical) you'd not have any issue.