|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Strategy that encapsulates certain functionality that standard JDO 1.0 does not offer despite being relevant in the context of O/R mapping, like access to the underlying JDBC connection and explicit flushing of changes to the database.
To be implemented for specific JDO implementations like Kodo, Lido, or JDO Genie. Almost every O/R-based JDO implementation will offer proprietary means to access the underlying JDBC Connection and to explicitly flush changes. JDO 2.0 respectively JDO/R 2.0 are likely to define standard ways for these: If applicable, a JdoDialect implementation for JDO 2.0 will be provided to leverage them with Spring's JDO support.
Method Summary | |
void |
flush(javax.jdo.PersistenceManager pm)
Flush the given persistence manager, i.e. |
java.sql.Connection |
getJdbcConnection(javax.jdo.PersistenceManager pm)
Retrieve the JDBC connection that the given JDO persistence manager uses underneath, if accessing a relational database. |
DataAccessException |
translateException(javax.jdo.JDOException ex)
Translate the given JDOException to a corresponding exception from Spring's generic DataAccessException hierarchy. |
Method Detail |
public java.sql.Connection getJdbcConnection(javax.jdo.PersistenceManager pm) throws javax.jdo.JDOException
This strategy is necessary as JDO 1.0 does not provide a standard way to retrieve the underlying JDBC Connection (due to the fact that a JDO implementation might not work with a relational database at all).
pm
- the current JDO persistence manager
javax.jdo.JDOException
- in case of retrieval errorsJdoTransactionManager.setDataSource(javax.sql.DataSource)
public void flush(javax.jdo.PersistenceManager pm) throws javax.jdo.JDOException
pm
- the current JDO persistence manager
javax.jdo.JDOException
- in case of errorsJdoAccessor.setFlushEager(boolean)
public DataAccessException translateException(javax.jdo.JDOException ex)
Of particular importance is the correct translation to ObjectRetrievalFailureException, ObjectOptimisticLockingFailureException, and DataIntegrityViolationException. Unfortunately, standard JDO does not allow for portable detection of those.
ex
- the JDOException thrown
JdoAccessor.convertJdoAccessException(javax.jdo.JDOException)
,
JdoTransactionManager.convertJdoAccessException(javax.jdo.JDOException)
,
PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException)
,
ObjectRetrievalFailureException
,
ObjectOptimisticLockingFailureException
,
DataIntegrityViolationException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |