• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entitybean

 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys

I guess this is simple

For entity beans
Is Container managed persistance anyway related to Container Manged Transactions.
Also, Is Bean managed persistance anyway related to Bean Managed
transactions.

or are they completely different but work in the same way.

any responces appreciated
thanks
J
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An entity bean(with BMP or CMP) cannot have bean-managed transactions.

Now your questions.

Is Container managed persistance anyway related to Container Managed Transactions.
Yes

Also, Is Bean managed persistance anyway related to Bean Managed
transactions.

No
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks karthi.

>>>An entity bean(with BMP or CMP) cannot have bean-managed transactions.
are you 100% sure about this?


I feel
CMP with BMT is a bad choice.
but BMP with BMT is possible.
 
Durgaprasad Guduguntla
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jay roy:
CMP with BMT is a bad choice.
but BMP with BMT is possible.

For entity beans you can choose either CMP or BMP as your persistence mechanism. Regarding transactions, for entity beans you should only use CMT irrespective of your persitence mechanism. For session beans, you will have the choice to choose from CMT or BMT. BMT should not be used for entity beans. You must use CMT even if your entity bean uses BMP. BMT can only be used for session beans. Ranchers, please correct me if I am wrong.
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks durgaprasad for the response.

when you say

>>>BMT should not be used for entity beans

Is there any specific practical reason why it should not be used?
Did you read it in any text book or a website or do you feel its a j2ee best practise to follow.

thanks,
J
 
Durgaprasad Guduguntla
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jay roy:

Is there any specific practical reason why it should not be used?
Did you read it in any text book or a website or do you feel its a j2ee best practise to follow.


The EJB specification 2.1 states this in article 17.6.1. You can download this here.

Note that only Session and Message-driven beans can be used with bean-managed transaction demarcation.A Bean Provider is not allowed to provide an Entity bean with bean-managed transaction demarcation.


Further you can also check out these links for more information:

http://java.boot.by/bcd-guide/ch11.html#c11s1

http://www.whizlabs.com/scbcd/scbcd-notes.html
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks durgaprasad.

if you get a chance, can you please take a look at this thread.

http://www.coderanch.com/t/155355/java-Architect-SCEA/certification/ejbhome


thanks
J
 
Ara Tatous
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at

http://www.novell.com/documentation/extendas35/docs/help/books/pgEJBSesBean.html


it talks about CMT, BMT for session and entity bean. It's very useful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic