- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 43 of file DaoFactory.java.
◆ close()
void org.turro.jpa.DaoFactory.close |
( |
| ) |
|
◆ closeElephant()
void org.turro.jpa.DaoFactory.closeElephant |
( |
| ) |
|
◆ createCachedEntityManager()
synchronized EntityManager org.turro.jpa.DaoFactory.createCachedEntityManager |
( |
String |
pu, |
|
|
String |
conf |
|
) |
| |
Definition at line 64 of file DaoFactory.java.
65 EntityManager cachedEM = cachedEMs.get(pu);
66 Long lastAccess = lastAccessEMs.get(pu);
67 Long time =
new Date().getTime();
68 if(lastAccess ==
null) lastAccess = time;
69 EntityManagerFactory factory = getFactory(pu, conf);
71 if(cachedEM ==
null || !(cachedEM.isOpen())) {
72 cachedEM = factory.createEntityManager();
73 }
else if(time > lastAccess + CLEAR_CACHE) {
75 }
else if(time > lastAccess + CLOSE_CACHE) {
79 cachedEM = factory.createEntityManager();
82 lastAccessEMs.put(pu, time);
83 cachedEMs.put(pu, cachedEM);
◆ createEntityManager()
EntityManager org.turro.jpa.DaoFactory.createEntityManager |
( |
String |
pu, |
|
|
String |
conf |
|
) |
| |
Definition at line 54 of file DaoFactory.java.
55 EntityManagerFactory factory = getFactory(pu, conf);
57 return factory.createEntityManager();
◆ getEmf()
EntityManagerFactory org.turro.jpa.DaoFactory.getEmf |
( |
| ) |
|
The documentation for this class was generated from the following file: