Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] EclipseLink OSGi bundles deployment in Tomcat (with Eclipse ServletBridge) errors.

Dear Tom,
 
The EclipseLink version that I am using right now is 1.0M8. I'll try to make use of the new release 1.0, but I don't think this will make much of a difference as it is working inside Eclipse IDE but not when deployed in Tomcat (using Eclipse ServletBridge to have the OSGi environment).
 
The code to create the EntityManagerFactory is as the following. Take note that I am using javax.persistence.Persistence to create entity manager factory rather than PersistenceProvider or Persistence classes specifically for OSGi (I'll try this out as well);
 

public

void persist(final Profile profile) {

if (log.isDebugEnabled()) {

log

.debug(

"ProfileServiceBean.persist(), the profile which is about to be persisted is ["

+ profile.getUName() +

"]");

}

final EntityManagerFactory entityManagerFactory = Persistence

.createEntityManagerFactory(

"entityManager");

if (log.isDebugEnabled()) {

log.debug("After getting the entity manager factory");

}

entityManager = entityManagerFactory.createEntityManager();

if (log.isDebugEnabled()) {

log.debug("After creating the entity manager");

}

final EntityTransaction entityTransaction = entityManager

.getTransaction();

entityTransaction.begin();

entityManager.persist(profile);

if (log.isDebugEnabled()) {

log.debug("After persisting the profile");

}

entityTransaction.commit();

entityManager.close();

entityManagerFactory.close();

}

Thank you for your time and immediate attention.
 
Regards,
Azrin.

On Mon, Jul 21, 2008 at 9:24 PM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
Hi Azrin,

 What EclipseLink version are you using?

 Can you post the code you are using to create your entity manager factory?

-Tom

Back to the top