1.1.1 BUG? Transaction not started in transactional service in plugin

View: New views
2 Messages — Rating Filter:   Alert me  

1.1.1 BUG? Transaction not started in transactional service in plugin

by _dms_ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Our application code splitted on several plugins. One plugin contains model classes and services, another plugin contains controllers. An applications contains only GSP. And we run into following issue: transactions not started in transactional services which resides in plugin. I created test application with test plugin which reproduces this issue (see attachment).

TxBug is a plugin with transactional service.
TxBugApp is an application, which uses this plugin.
There no need to install plugin - TxBugApp contains BuildConfig.groovy which stores relative location of the plugin.

To watch transactions I added "trace  'org.springframework.transaction'" in Config.groovy.
Each service throws IllegalStateException which must rollback started transaction.

After starting application goto org.somecompany.TxTestAppController link and press callAppService link. Application log shows this:

.....
2009-11-03 17:36:19,824 [32812850@qtp0-0] TRACE support.TransactionSynchronizationManager  - Initializing transaction synchronization
2009-11-03 17:36:19,826 [32812850@qtp0-0] TRACE interceptor.TransactionInterceptor  - Getting transaction for [org.somecompany.TxTestAppService.serviceMethod]
2009-11-03 17:36:19,833 [32812850@qtp0-0] TRACE interceptor.TransactionInterceptor  - Completing transaction for [org.somecompany.TxTestAppService.serviceMethod] after exception: java.lang.IllegalArgumentException: tx-test-app
2009-11-03 17:36:19,874 [32812850@qtp0-0] TRACE interceptor.RuleBasedTransactionAttribute  - Applying rules to determine whether transaction should rollback on java.lang.IllegalArgumentException: tx-test-app
2009-11-03 17:36:19,874 [32812850@qtp0-0] TRACE interceptor.RuleBasedTransactionAttribute  - Winning rollback rule is: null
2009-11-03 17:36:19,874 [32812850@qtp0-0] TRACE interceptor.RuleBasedTransactionAttribute  - No relevant rollback rule found: applying default rules
2009-11-03 17:36:19,874 [32812850@qtp0-0] TRACE support.TransactionSynchronizationManager  - Clearing transaction synchronization

.....

We can see that transaction is started and rollbacked.

Return to previous page (pressing Back button in browser) and press callPluginService link.
Log now contains no information about transaction!

Both services marked as transactional by placing "boolean transactional = true"

Is this a bug and is there any quick workaround ?


TxBug.zip

Re: 1.1.1 BUG? Transaction not started in transactional service in plugin

by _dms_ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've created JIRA issue http://jira.codehaus.org/browse/GRAILS-5311 with patch