Hi, everybody.
It's a backport of http://jira.grails.org/browse/GRAILS-7093 https://github.com/daniel-lima/grails-transaction-handling-plugin http://grails.org/plugin/transaction-handling Usage examples: https://github.com/daniel-lima/grails-transaction-handling-plugin/blob/master/test/integration/transaction/handling/DynamicMethodsTests.groovy TestUser.withTransaction { } TestUser.withTransaction(isolation: 'readUncommitted') { } TestUser.withTransaction(readOnly: true, timeout: 'default') { } TestUser.withTransaction(propagationBehaviorName: 'PROPAGATION_MANDATORY', timeout: 765) { } TestUser.withTransaction(propagation: "mandatory") { } TestUser.withNewTransaction { } TestUser.withNewTransaction(isolationLevel: TransactionDefinition.ISOLATION_SERIALIZABLE) { } TestUser.withNewTransaction(propagation: 'supports', readOnly: true, timeout: 612) { } TestUser.withNewTransaction(isolationLevelName: 'ISOLATION_REPEATABLE_READ') { } Best regards, Daniel. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
Hi.
(I still need to document this plugin properly :-|). "Configurable defaults" are now available: https://github.com/daniel-lima/grails-transaction-handling-plugin/blob/master/grails-app/conf/TransactionHandlingDefaultConfig.groovy If Config.groovy contains: grails.plugin.transactionHandling.programmatic.timeout = 30000 grails.plugin.transactionHandling.programmatic.readOnly = true TestUser.withTransaction { } or TestUser.withTransaction(isolation: 'readUncommitted') { } Will create read only transactions with timeout equal to 30000 grails.plugin.transactionHandling.global.timeout = 70000 Will affect the defaultTimeout of the installed transactionManager, influencing *any* transaction. Best regards, Daniel. Daniel H A Lima wrote: > Hi, everybody. > > It's a backport of http://jira.grails.org/browse/GRAILS-7093 > > https://github.com/daniel-lima/grails-transaction-handling-plugin > http://grails.org/plugin/transaction-handling > > Usage examples: > > https://github.com/daniel-lima/grails-transaction-handling-plugin/blob/master/test/integration/transaction/handling/DynamicMethodsTests.groovy > > TestUser.withTransaction { > } > > > TestUser.withTransaction(isolation: 'readUncommitted') { > } > > TestUser.withTransaction(readOnly: true, timeout: 'default') { > } > > TestUser.withTransaction(propagationBehaviorName: 'PROPAGATION_MANDATORY', timeout: 765) { > } > > > TestUser.withTransaction(propagation: "mandatory") { > } > > > TestUser.withNewTransaction { > } > > > TestUser.withNewTransaction(isolationLevel: TransactionDefinition.ISOLATION_SERIALIZABLE) { > } > > > TestUser.withNewTransaction(propagation: 'supports', readOnly: true, timeout: 612) { > } > > > TestUser.withNewTransaction(isolationLevelName: 'ISOLATION_REPEATABLE_READ') { > } > > > Best regards, > > Daniel. > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
New version of the plugin (docs updated):
http://www.grails.org/plugin/transaction-handling Thanks. Best regards, Daniel.
2011/8/9 Daniel Henrique Alves Lima <[hidden email]> Hi. |
Free forum by Nabble | Edit this page |