Class DAOUtilTransactionManager

java.lang.Object
org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.jdbc.datasource.DataSourceTransactionManager
fr.paris.lutece.portal.service.database.DAOUtilTransactionManager
All Implemented Interfaces:
PluginEventListener, Serializable, org.springframework.beans.factory.InitializingBean, org.springframework.transaction.PlatformTransactionManager, org.springframework.transaction.support.ResourceTransactionManager, org.springframework.transaction.TransactionManager

public class DAOUtilTransactionManager extends org.springframework.jdbc.datasource.DataSourceTransactionManager implements PluginEventListener
DataSource transaction manager. This transaction manager use Spring transaction manager, and do not use TransactionManager. This transaction manager allow to use transaction in a given plugin, but does not influence other plugins. To create transactions throw multiple plugins, use LuteceTransactionManager
See Also:
  • Field Summary

    Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager

    SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
  • Constructor Summary

    Constructors
    Constructor
    Description
    Registers the listener to PluginService.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a "fake" datasource to avoid spring checks failure when pool are not initialized.
    Gets the plugin name
    void
    Process a plugin event
    void
    setPluginName(String strPluginName)
    Sets the plugin name

    Methods inherited from class org.springframework.jdbc.datasource.DataSourceTransactionManager

    afterPropertiesSet, getResourceFactory, isEnforceReadOnly, setDataSource, setEnforceReadOnly

    Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager

    commit, getDefaultTimeout, getTransaction, getTransactionSynchronization, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.transaction.PlatformTransactionManager

    commit, getTransaction, rollback
  • Constructor Details

    • DAOUtilTransactionManager

      public DAOUtilTransactionManager()
      Registers the listener to PluginService.
  • Method Details

    • getPluginName

      public String getPluginName()
      Gets the plugin name
      Returns:
      the plugin name
    • setPluginName

      public void setPluginName(String strPluginName)
      Sets the plugin name
      Parameters:
      strPluginName - the plugin name
    • processPluginEvent

      public void processPluginEvent(PluginEvent event)
      Process a plugin event
      Specified by:
      processPluginEvent in interface PluginEventListener
      Parameters:
      event - The event to process
    • getDataSource

      public DataSource getDataSource()
      Returns a "fake" datasource to avoid spring checks failure when pool are not initialized. Returns the current datasource otherwise.
      Overrides:
      getDataSource in class org.springframework.jdbc.datasource.DataSourceTransactionManager
      Returns:
      the data source