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.
Azrin.