Skip to content

Instantly share code, notes, and snippets.

@paulrobinson
Created May 31, 2012 10:47
Show Gist options
  • Save paulrobinson/2842605 to your computer and use it in GitHub Desktop.
Save paulrobinson/2842605 to your computer and use it in GitHub Desktop.
WSBA -> JTA Bridging with TXFramework
@BA
@Stateless @Remote(Bistro.class) @WebService()
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public class BistroImpl implements Bistro
{
@DataManagement private Map txDataMap;
@PersistenceContext protected EntityManager em;
@WebMethod
@ServiceRequest
public void bookSeats(int howMany) {
txDataMap.put("howMany", howMany);
//Use em to increase booking count in DB
}
@Compensate
private void compensate() {
int howMany (Integer) txDataMap.get("howMany");
//Use em to decrease booking count in DB
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment