0% found this document useful (0 votes)
751 views6 pages

Hybris Commerce Developer Training 1.09 - Transactions

Hybris Commerce Developer Training 1.09 - Transactions

Uploaded by

oblomir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
751 views6 pages

Hybris Commerce Developer Training 1.09 - Transactions

Hybris Commerce Developer Training 1.09 - Transactions

Uploaded by

oblomir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Transactions

hybris Commerce
Developer Training
Part I
Copyright hybris AG

Transactions
Licensed to
ACME CORP
for internal training

Transactions are ACID (atomic, consistent, isolated, durable)

Hybris provides implementation of spring PlatformTransactionManager


so you can use:
@Transaction
tx xml schema
TransactionTemplate
Or direct hybris API

The JTA UserTransaction interface is not provided

hybris doesnt participate in global transactions of multiple systems

Transactions Overview | 93
Copyright hybris AG

Transactions isolation
Licensed to
ACME CORP
for internal training

Isolation level is fixed to READ_COMMITED


you cant change that with @Transactional annotation (ignored)

Nested transactions are supported


inner transaction simply joins outer transaction

Models are persisted without transaction by default:
model.service.transactional.saves=false

More info at:

wiki.hybris.com/display/release5/Transactions

Transactions Overview | 94
Copyright hybris AG

Annotation example
Licensed to
ACME CORP
for internal training

The easiest way to enable transactions in your code


@Transactional(propagation=Propagation.REQUIRES_NEW,
isolation=SERIALIZABLE)
public void provideService()
{
repo1.retrieveFoo();
repo2.retrieveFoo();
}


Notice the isolation level will be ignored!

Transactions Overview | 95

You might also like