In the following setup, does method B run in a (new) transaction?
An EJB, having two methods, method A and method B
public class MyEJB implements SessionBean
public void methodA() ...
|
I am referring to container managed transaction attributes in Enterprise Java Beans. I can't think of any use cases where using 'Mandatory' and 'Never' makes sense. Can anyone please explain what ... |
Are we allowed to specify a method name with an access modifier of 'protected' or 'private' inside the <container-transaction><method></method></contaner-transaction> tag ?
Below is a sample of the ejb-jar.xml:
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
...
|
I read that EJB 2.x spec does not support nested transactions.
But logically think we can call an EJB method that has REQUIRES_NEW txn attribute from another EJB method that acutally started ... |
I'm using 2 PU in stateless EJB and each of them is invoked on one method:
@PersistenceContext(unitName="PU")
private EntityManager em;
@PersistenceContext(unitName="PU2")
private EntityManager em2;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW )
public void getCandidates(final Integer eventId) throws ControllerException {
...
|
I have a @Stateless EJB with a @WebService interface, using container managed transactions, meaning transactions are automatically committed by the container after a method has been called if it doesn't ... |
I wan to know how the transaction is internally implemented in EJB. I want to know the logic they use to create a transaction. if you could point out some articles ... |
|
I have an EJB (coded using Java EE 6 annotations) that is defined as follows:
@Stateless
@WebService
public class SecurityWebService {
public void registerUser(RegistrationRequest request) {
...
|
I need some direction how to best use Exceptions in a JEE environment, serving clients via JAX-RS.
At the moment, I have a number of exceptions, all extending RuntimeException, and annotated with ... |
Can you call a method that requires a transaction inside a method that does not?
@TransactionAttribute(value = TransactionAttributeType.NEVER)
public void DoSomething(final List<Item> items) {
//can you call a method that requires a transaction here ...
|
I have the following scenario,
public void someEjbMethod1()
{
for (int i=0; i=10; i++)
{
em.merge(arr[i]);
...
|
Can we specify the transactionManagent/transactionAttribute(like required or Requiresnew ) to mention how the Container must manage transactions for a method
when a client invokes the method of session bean with ... |
In the CustomerTransactions entity, I have the following field to record what the customer bought:
@ManyToMany
private List<Item> listOfItemsBought;
When I think more about this field, there's a chance it may not work because ... |
|
hi all, I am little bit confused with EJB Transactions. What I heard is we cannot control transactions in EJB with Connection.setAutoCommint(false) and Connection.commit() and Connection.rollback(); the EJB Container Starts a Transaction , if everything goes well the transaction will be commited otherwise in the catch block we have use SessionContext.setRollbackOnly(); but I am getting different results... I have Stateless Session ... |
|
Hi, I am trying to persist a data by using EntityManager.persist method. I am using EJB 3.0 Stateless Session Facade Bean and its transaction is Container-Managed. (CMP) After persist operation, within the same ejb method, I am trying to update the data by using a JDBC "Update" query. But the problem is that the data is not updated. The transaction is ... |
|
Hi All, I am using Bean Managed Trasactions.If i call a method from one Ejb to Another Ejb new trasaction is created in called method and it is commited(If this Method Executes successfully).The old transaction which started in first Ejb is not yet commited(In calling Method). If calling method exceutes fails the old transaction rolledback.In this case i want new Trasaction ... |
Hello, I use Ejb 2.0 and want to store some date in the DB. I put restriction on the table, Primary Key and Not null. If I put the key with a name already exist, all is null, I get: Transaction failure in method: Is it possible to get more detailed information, what was the reason of the problem? Because the ... |
Hi, I have an EJB running on a WSAD 5.1 which access a remote EJB running on WAS 6. The remote EJB uses a XA datasource. When the create() method is called, I get the following exception: javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 0x0 No; nested exception is: org.omg.CORBA.TRANSACTION_ROLLEDBACK: Trace from server: 1198777258 at host li09 >> org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x0 minor code: 0 completed: ... |