• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About @AfterBegin definition on the study notes

 
Himai Minh
Ranch Hand
Posts: 1360
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, on Frit's notes p. 24, session 2.3.7.1 , it says

The afterBegin notification signals a session bean instance that a new transaction has begun. The container invokes this method before the first business method within a transaction (which is not necessarily at the beginning of the transaction.)


Does "Which is not necessarily at the beginning of the transaction" refers to the first business method?
Does it mean the first business method within a transaction is not always at the beginning of the transaction?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2533
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it mean the first business method within a transaction is not always at the beginning of the transaction?

Yes, the answer comes from the specs (4.3.7):
The afterBegin notification is invoked with the transaction context. The instance may do any database work it requires within the scope of the transaction.
 
Himai Minh
Ranch Hand
Posts: 1360
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also think that an interceptor method can be the first method in a transaction before the first business method is called within this transaction.
That may be why JSR 318 says the first business method may not be necessarily at the beginning of a transaction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic