org.jpox.springframework
Class JPOXJdoDialect

java.lang.Object
  extended byorg.springframework.orm.jdo.DefaultJdoDialect
      extended byorg.jpox.springframework.JPOXJdoDialect
All Implemented Interfaces:
org.springframework.orm.jdo.JdoDialect

public class JPOXJdoDialect
extends org.springframework.orm.jdo.DefaultJdoDialect

Dialect for using JPOX within Spring's JDO support, giving finer control over transactions and queries.

Version:
$Revision: 1.5 $

Field Summary
 
Fields inherited from class org.springframework.orm.jdo.DefaultJdoDialect
logger
 
Constructor Summary
JPOXJdoDialect()
           
 
Method Summary
 void applyQueryTimeout(javax.jdo.Query query, int remainingTimeInSeconds)
          Method to apply a timeout to the specified query.
 java.lang.Object beginTransaction(javax.jdo.Transaction transaction, org.springframework.transaction.TransactionDefinition definition)
          Method to start a transaction.
 void flush(javax.jdo.PersistenceManager pm)
          Method to flush changes to the datastore.
 org.springframework.jdbc.datasource.ConnectionHandle getJdbcConnection(javax.jdo.PersistenceManager pm, boolean readOnly)
          Accessor for JDBC connection.
 void releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle conHandle, javax.jdo.PersistenceManager pm)
          Method to release a previously obtained connection.
 
Methods inherited from class org.springframework.orm.jdo.DefaultJdoDialect
attachCopy, attachCopyAll, cleanupTransaction, detachCopy, detachCopyAll, extractSqlStringFromException, getJdbcExceptionTranslator, getPersistenceManagerFactory, newNamedQuery, setJdbcExceptionTranslator, setPersistenceManagerFactory, translateException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPOXJdoDialect

public JPOXJdoDialect()
Method Detail

beginTransaction

public java.lang.Object beginTransaction(javax.jdo.Transaction transaction,
                                         org.springframework.transaction.TransactionDefinition definition)
                                  throws javax.jdo.JDOException
Method to start a transaction. Hooks into JPOX's configurability for transactions.

Parameters:
transaction - The transaction to start
definition - Definition of the transaction
Returns:
The transaction
Throws:
javax.jdo.JDOException

getJdbcConnection

public org.springframework.jdbc.datasource.ConnectionHandle getJdbcConnection(javax.jdo.PersistenceManager pm,
                                                                              boolean readOnly)
                                                                       throws java.sql.SQLException
Accessor for JDBC connection. Hooks into JPOX's datastore connection accessor.

Parameters:
pm - The Persistence Manager
readOnly - Whether to open it read only
Returns:
The Connection handle
Throws:
java.sql.SQLException - Thrown if an error occurs in accessing it

releaseJdbcConnection

public void releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle conHandle,
                                  javax.jdo.PersistenceManager pm)
                           throws java.sql.SQLException
Method to release a previously obtained connection. Hooks into JPOX's datastore connection retriever.

Parameters:
conHandle - The Connection handle
pm - The PersistenceManager
Throws:
java.sql.SQLException - Thrown if an error occurs in returning it

applyQueryTimeout

public void applyQueryTimeout(javax.jdo.Query query,
                              int remainingTimeInSeconds)
                       throws javax.jdo.JDOException
Method to apply a timeout to the specified query.

Parameters:
query - The query
remainingTimeInSeconds - The timeout to apply
Throws:
javax.jdo.JDOException - Thrown when an error occurs setting the timeout.

flush

public void flush(javax.jdo.PersistenceManager pm)
           throws javax.jdo.JDOException
Method to flush changes to the datastore.

Parameters:
pm - The Persistence Manager
Throws:
javax.jdo.JDOException - Thrown if an error occurs in flushing


Copyright © 2003-2007 Java Persistent Objects (JPOX). All Rights Reserved.