[jboss-user] [EJB 3.0] - Re: need help for Transaction Attribute Types
wolfc
do-not-reply at jboss.com
Wed Aug 15 17:50:43 EDT 2007
Please try the following:
@Stateful
| @Remote(TestFasade.class)
| public class TestFasadeBean implements TestFasade {
|
| @PersistenceContext(type = PersistenceContextType.EXTENDED)
| EntityManager oracleManager;
| Test test;
|
| @TransactionAttribute(NEVER)
| public Long create() {
| try {
| test = new Test();
| test.setAge(21L);
| test.setName("adsdasd");
| test.setSurname("asdasd");
| oracleManager.persist(test);
| return test.getId();
| } catch (Exception e) {
| e.printStackTrace();
| return 0L;
| }
| }
|
| @TransactionAttribute(REQUIRED)
| public void comit() {
| try {
| oracleManager.flush();
| } catch (Exception e) {
| e.printStackTrace();
| }
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074599#4074599
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074599
More information about the jboss-user
mailing list