IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerworks > My developerWorks >  Dashboard > WebSphere eXtreme Scale V6.1 User Guide > ... > Introduction to the EntityManager API > EntityTransaction interface
developerWorks
Log In   View a printable version of the current page.
Overview Connect Spaces Forums Wikis
EntityTransaction interface
Added by RKATARYA, last edited by Chris.D.Johnson on May 31, 2007  (view change)
Labels: 

Getting Started Examples Reference API documentation

See the WebSphere eXtreme Scale Wiki for links to eXtreme Scale Version 7.0 documentation.
If you log in with your developerWorks ID, you can leave comments and feedback for the development team.

An EntityTransaction is associated with an EntityManager and is used to demarcate a transaction.
Use the EntityManager.getTransaction() method to retreive the EntityManager's EntityTransaction instance.
Each EntityManager and EntityTransaction are associated with the ObjectGrid Session. Transaction demarcation can be performed using either the EntityTransaction or ObjectGrid Session. Methods on the EntityTransaction interface do not have any checked exception. Only RuntimeExceptions of type PersistenceException or its sub classes are thrown.

EntityTransaction interface is contained in package com.ibm.websphere.objectgrid.em. The following methods are defined on this interface.

public void begin();

Begins a new transaction. Can throw IllegalStateException or PersistenceException.

public void commit()

Commit the current transaction, flushing any uncommitted changes in the EntityManager's context to the cache.

public void rollback()

Rolls back the current transaction.

public boolean isActive();

Indicate whether a transaction is in progress.

public void setRollbackOnly();

Mark the current transaction so that the only possible outcome of
the transaction is for the transaction to be rolled back.

public boolean getRollbackOnly();

Determine whether the current transaction has been marked for rollback.

Wiki Disclaimer and License
© Copyright IBM Corporation 2007,2009. All Rights Reserved.


 
    About IBM Privacy Contact