Chandrashekhar Raiphale

Greenhorn
+ Follow
since Aug 26, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chandrashekhar Raiphale

Congratulations! Congratulations!! Congratulations !!!

Would you mind to share script of about 260 pages?

Cheers!!!
11 years ago
This may also help you.

Page no 46 of "ejb-3_0-fr-spec-persistence.pdf" Entity Operaions


/**
* Indicate to the EntityManager that a JTA transaction is
* active. This method should be called on a JTA application
* managed EntityManager that was created outside the scope
* of the active transaction to associate it with the current
* JTA transaction.
* @throws TransactionRequiredException if there is
* no transaction.
*/
public void joinTransaction();
yes, that is alos correct.

see "Table 12 Container’s Actions for Methods of Beans with Bean-Managed Transaction".

If the transaction associated with the instance is T1, then business called will be execuated in same transaction.

There will not be new transaction, if you tried to create one, you will get javax.transaction.NotSupportedException in the begin
method.



following lines from MK's study guide

"A stateful session bean instance may, but is NOT REQUIRED to, commit a started transaction before a business method returns. If a transaction has not been completed by the end of a business method, the container retains the association between the transaction and the instance across multiple client calls until the instance eventually completes the transaction. "
Hi, Please read on page no 325 of core-specification. It says

"An instance that starts a transaction must complete the transaction before it starts a new transaction."

"A stateful session bean instance may, but is not required to, commit a started transaction before a business
method returns.
If a transaction has not been completed by the end of a business method, the container
retains the association between the transaction and the instance across multiple client calls until
the instance eventually completes the transaction."


Read on page no 343 of core-specification. It says

"When an instance attempts to start a transaction using the begin method of the javax.transaction.
UserTransaction interface while the instance has not committed the previous transaction,
the container must throw the javax.transaction.NotSupportedException in the begin
method."
can you check this link

http://edocs.bea.com/wls/docs100/ejb30/program.html

Let me know was this helpful for you or not
I think yes,

Because in figure 27 they talk about javax.transaction.UserTransaction begin() and commit() on client, which is done in case of bean-managed transaction demarcation; where as in figure 28 they have shown the transaction started by server with transaction attribute is "REQUIRED", which is done in case of container-managed transaction demarcation when transaction not defined in deployment descriptor.

Please correct me if I am wrong.
Following is text form core specification. I hope this will clear your doubt.

An enterprise bean with bean-managed transaction demarcation must not use the getRollbackOnly and setRollbackOnly methods of the EJBContext interface. An enterprise bean with bean-managed transaction demarcation has no need to use these methods, because of the following reasons:
�An enterprise bean with bean-managed transaction demarcation can obtain the status of a transaction by using the getStatus method of the javax.transaction.User-Transaction interface.
� An enterprise bean with bean-managed transaction demarcation can rollback a transaction using the rollback method of the javax.transaction.UserTransaction interface.

The container must throw the java.lang.IllegalStateException if an instance of a bean with bean-managed transaction demarcation attempts to invoke the setRollbackOnly or getRollbackOnly method of the javax.ejb.EJBContext interface.



An enterprise bean with container-managed transaction demarcation can use the setRollbackOnly method of its EJBContext object to mark the transaction such that the transaction can never commit. Typically, an enterprise bean marks a transaction for rollback to protect data integrity before throwing an application exception, if the application exception class has not been specified to automatically cause the container to rollback the transaction.

For example, an AccountTransfer bean which debits one account and credits another account could mark a transaction for rollback if it successfully performs the debit operation, but encounters a failure during the credit operation.
I tried it for method in Stateless session bean. There is no problem if method name starts with ejb like "ejbSomeMethod()". It works perfectly.
Have a look at following link, they have shown 2 way sof EJB lookup but both are using JNDI name ...let me now is this what you were expecting


http://www.theserverside.com/tt/articles/article.tss?l=SimplifyingEJB3
Have a look at following point in core specifications, hope this will help you.

13.6.5 Handling of Methods that Run with �an unspecified transaction context�
there was no compilation error as such but when i started server i got the Exception on server log, which i wrote in my pevious post.
I tried with Eclipse + Weblogic and got following error on server console:


Unable to deploy EJB: sims.ejb.TestSB

Cannot inherit from final class
Hi,

Are you able to open above link? I am getting "Page not found error"
Hi,
This loop will run 11 times and will create 11 object in loop, so the answer given that there is right.