org.eclipse.persistence.transaction.JTATransactionController Java Examples

The following examples show how to use org.eclipse.persistence.transaction.JTATransactionController. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EclipseLinkSessionCustomizer.java    From piranha with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Customize the session.
 * 
 * @param session the session.
 * @throws Exception when a serious error occurs.
 */
@Override
public void customize(Session session) throws Exception {
    InitialContext initialContext = new InitialContext();
    TransactionManager transactionManager = (TransactionManager) initialContext.lookup("java:/TransactionManager");
    session.setExternalTransactionController(new JTATransactionController(transactionManager));
}
 
Example #2
Source File: Initializer.java    From tomee with Apache License 2.0 4 votes vote down vote up
@PostConstruct
private void init() {
    JTATransactionController.setDefaultTransactionManager(tm);
}