Added read-only option to non-propagating user transactions as well as TransactionUtil methods

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2420 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-02-16 19:35:22 +00:00
parent 2928954e0a
commit e5b9b0ccd3
3 changed files with 69 additions and 11 deletions

View File

@@ -99,4 +99,18 @@ public class TransactionComponent implements TransactionService
TransactionDefinition.TIMEOUT_DEFAULT);
return txn;
}
/**
* @see org.springframework.transaction.TransactionDefinition#PROPAGATION_REQUIRES_NEW
*/
public UserTransaction getNonPropagatingUserTransaction(boolean readOnly)
{
SpringAwareUserTransaction txn = new SpringAwareUserTransaction(
transactionManager,
(readOnly | this.readOnly),
TransactionDefinition.ISOLATION_DEFAULT,
TransactionDefinition.PROPAGATION_REQUIRES_NEW,
TransactionDefinition.TIMEOUT_DEFAULT);
return txn;
}
}