-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: EntityManager returned as null in Java SE
PostPosted: Thu Jul 09, 2009 9:55 pm 
Newbie

Joined: Sun Jul 05, 2009 9:59 pm
Posts: 6
Hi,
I am getting a null EntityManager in Java SE. Following is my META-INF/persistence.xml. Please help.
Code:
<persistence-unit name="library">

      <properties>
         <!-- Scan for annotated classes and Hibernate mapping XML files -->
         <property name="hibernate.archive.autodetection" value="class, hbm" />

         <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" />
         <property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://localhost:9010/library" />
         <property name="hibernate.connection.username" value="libadmin" />
         <property name="hibernate.connection.password" value="***" />

         <property name="hibernate.c3p0.min_size" value="5" />
         <property name="hibernate.c3p0.max_size" value="20" />
         <property name="hibernate.c3p0.timeout" value="300" />
         <property name="hibernate.c3p0.max_statements" value="50" />
         <property name="hibernate.c3p0.idle_test_period" value="3000" />

         <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />

      </properties>
   </persistence-unit>

I am creating EntityManager by the following code:
Code:
private EntityManager getEntityManager() {
   return Persistence.createEntityManagerFactory("library")
      .createEntityManager();
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.