Unsure if I understand TransactionAwarePersistenceManagerFactoryProxy Unsure if I understand TransactionAwarePersistenceManagerFactoryProxy java java

Unsure if I understand TransactionAwarePersistenceManagerFactoryProxy


Answers are directly available on documentation

I realize it can help make my DAOs work with a plain JDO PersistenceManagerFactory.

Yes.TransactionAwarePersistenceManagerFactoryProxy proxy allows DAOs to work with a plain JDO PersistenceManagerFactory reference, while still participating in Spring's (or a J2EE server's) resource and transaction management.You can surely use it in your app. But without knowing your exact needs, we can't confirm any further.

Can I still use it to access my factory to create a transaction aware persistence manager

DAOs could seamlessly switch between a JNDI PersistenceManagerFactory and this proxy for a local PersistenceManagerFactory.

If the object managed by the factory is a singleton, does this change things? Why not just access the PersistenceManagerFactory directly?

It is usually preferable to write your JDO-based DAOs with Spring's JdoTemplate, offering benefits such as consistent data access exceptions instead of JDOExceptions at the DAO layer. However, Spring's resource and transaction management (and Dependency Injection) will work for DAOs written against the plain JDO API as well.