SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
The annotation
code:
@TransactionAttribute(REQUIRED)
marks the start
of a JTA transaction. My question is, what marks the end of the above JTA method transaction. Is there anything in code that marks the end of the JTA
transaction method? How does the container know ?
Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
- Marimuthu Madasamy
Originally posted by Marimuthu Madasamy:
Transaction Scoped Persistence context starts and ends within the scope of a business method.
Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Here the REQUIRED transaction attribute specfies that the method has to be executed in a transaction.
All container managed transaction scoped entity managers depend on JTA transactions. The reason for this is because they can use the transaction as a way to track persistence contexts. Every time an operation is invoked on the entity manager, it checks to see if a persistence context is associated with the transaction.
If it finds one, the entity manager will use this persistence context. If it doesn�t find one, then it creates a new persistence context and associates it with the transaction. When the transaction ends, the persistence context goes away.
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
- Marimuthu Madasamy
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
The application may obtain a container-managed entity manager with transaction-scoped persistence
context bound to the JTA transaction by injection or direct lookup in the JNDI namespace. The persistence
context type for the entity manager is defaulted or defined as PersistenceContext-
Type.TRANSACTION.
A new persistence context begins when the container-managed entity manager is invoked[36] in the
scope of an active JTA transaction, and there is no current persistence context already associated with
the JTA transaction. The persistence context is created and then associated with the JTA transaction.
The persistence context ends when the associated JTA transaction commits or rolls back, and all entities
that were managed by the EntityManager become detached.
If the entity manager is invoked outside the scope of a transaction, any entities loaded from the database
will immediately become detached at the end of the method call.
Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|