2 Replies Latest reply on Feb 7, 2006 5:25 PM by k2shah

    Hibernate Dialect in EJB 3.0 RC5

    k2shah

      In EJB 3.0 RC1, I used to be able to do this to get the current SQL Dialect for the underlying Hibernate Session Factory...

      ManagedEntityManagerFactory factory = (ManagedEntityManagerFactory) context.lookup("java:managedEntityFactories/EMSEntityManager");
      HibernateEntityManagerFactory hemf = (HibernateEntityManagerFactory)factory.getEntityManagerFactory();
      sqlDialect = ((SessionFactoryImpl)hemf.getSessionFactory()).getDialect();
      


      In EJB 3.0 RC5, there seems to be a change in that the EntityManagerFactory is not bound to JNDI unless explicitly told to do so through the persistence.xml. However, the EntityManagerFactory that is bound is of type org.jboss.ejb3.entity.InjectedEntityManagerFactory. This makes it difficult for me to get the hibernate session factory as a result.

      Any suggestions as to how I can get this bit of information?

      Thanks,
      Kartik