Mantis - Resin
Viewing Issue Advanced Details
2498 minor always 03-06-08 08:30 03-12-08 10:26
ferg  
ferg  
normal  
closed  
fixed  
none    
none 3.1.6  
0002498: @In with third-party EntityManagerFactory
(rep by wesley)


I've expierenced a wired problen using @PersistenceUnit.

===================Not functional!========================
@Component
public class PersistenceStrategy {

// @PersistenceContext(unitName = "myunit")
// EntityManager em;

@PersistenceUnit(unitName = "myunit")
EntityManagerFactory emf;

... // using emf, resin said
// com.mycompany.PersistenceStrategy.emf: @PersistenceUnit(unitName='myunit')
// is an unknown persistence unit.
// No matching JPA persistence-units have been deployed

}
============================================================


=========================OK=================================
@Component
public class PersistenceStrategy {

@PersistenceContext(unitName = "myunit")
EntityManager em;

@PersistenceUnit(unitName = "myunit")
EntityManagerFactory emf;

... // using emf, just leaving em unused
}
============================================================

I'm use Hibernate 3.2 as my persistence layer, with 3.1.s080304 snapshot.
Other configurations were normal and simple, as http://wiki.caucho.com/Hibernate [^] recommended.


Notes
(0002842)
ferg   
03-12-08 10:26   
jpa/2140

This was an initialization timing issue between http://caucho.com/resin/doc/resin-ioc.xtp [^] and http://caucho.com/resin/doc/amber.xtp [^]