Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Linux, jdk 1.5, grails 1.1.1, app-engine 0.8.5, gorm-jpa 0.5
Description
Received an exception when trying to delete when using the unmodified controller created by generate-all.
Steps to reproduce
- install gorm-jpa
- create domain
- generate-all for domain
- grails app-engine run
- Using the create page to create a new record. Click Create
- On the show page, Click the Delete button and Click OK.
- Received the following exception (see attachment as well)
Caused by: javax.persistence.TransactionRequiredException: This operation requires a transaction yet it is not active
Solution
- I was able to see the Event.withTransaction closure for the save action and used that in the delete action and that solved my problem. My guess is the auto generated controler provided by gorm-jpa just needs to include this like it already does .save(flush:true) for the save action.
Event.withTransaction {
eventInstance.delete(flush:true)
}
Also, it was nigh impossible to find the affected version for this plugin/version. Sorry for not setting it; just really difficult.
Attachments
-
$i18n.getText("admin.common.words.hide")
- test.zip
- 28/Nov/09 3:17 PM
- 164 kB
- Scott Murphy
-
- test/.classpath 6 kB
- test/.project 0.5 kB
- test/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- test/application.properties 0.2 kB
- test/build.xml 5 kB
- test/grails-app/conf/BootStrap.groovy 0.1 kB
- test/grails-app/conf/Config.groovy 3 kB
- test/grails-app/conf/DataSource.groovy 0.6 kB
- test/grails-app/.../datastore-indexes.xml 0.1 kB
- test/grails-app/conf/persistence.xml 0.7 kB
- test/grails-app/.../spring/resources.groovy 0.0 kB
- test/grails-app/conf/UrlMappings.groovy 0.2 kB
- test/.../AppEngineGormTestController.groovy 7 kB
- test/grails-app/.../AlbumController.groovy 3 kB
- test/grails-app/.../music/Album.groovy 0.3 kB
- test/grails-app/.../gorm/Permission.groovy 0.5 kB
- test/grails-app/domain/.../gorm/Role.groovy 0.9 kB
- test/grails-app/domain/.../gorm/User.groovy 0.6 kB
- test/grails-app/i18n/messages.properties 3 kB
- test/grails-app/.../messages_de.properties 3 kB
- test/grails-app/.../messages_es.properties 3 kB
- test/grails-app/.../messages_fr.properties 2 kB
- test/grails-app/.../messages_it.properties 2 kB
- test/grails-app/.../messages_ja.properties 2 kB
- test/grails-app/.../messages_nl.properties 3 kB
- test/.../messages_pt_BR.properties 3 kB
- test/grails-app/.../messages_ru.properties 4 kB
- test/grails-app/.../messages_th.properties 5 kB
- test/.../messages_zh_CN.properties 2 kB
- test/grails-app/views/album/create.gsp 2 kB
-
- gorm-jpa-delete-exception.png
- 247 kB
- 06/Nov/09 11:45 PM