Automatic transaction rollback with Spring

40 views
Skip to first unread message

szczepiq

unread,
Mar 14, 2010, 2:38:13 PM3/14/10
to givwenz...@googlegroups.com
Hey guys,

I think it would be useful to have an example how to do auto rollback with Spring and GWZ. If I manage to do it sometime soon I'll try to contribute ;p

Szczepan

Wes & Evie

unread,
Mar 21, 2010, 10:04:23 PM3/21/10
to givwenz...@googlegroups.com
sounds interesting, please create a new requests for this in the issues

after_thought

unread,
Mar 18, 2010, 12:55:29 PM3/18/10
to givwenzen_user
Sorry for the delay. We did this by following the guide on the gwz
site for integrating with spring. Then we just added a begin and
rollback method to the slim fixture. We injected the
transactionManager into the fixture.

Chuck

szczepiq

unread,
Mar 22, 2010, 8:18:24 AM3/22/10
to givwenz...@googlegroups.com
Chuck,

Do you mind sharing some code snippets (pastebin.com)? I can put it later on the wiki.

Cheers!
Szczepan

To unsubscribe from this group, send email to givwenzen_user+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

after_thought

unread,
Mar 23, 2010, 8:57:26 AM3/23/10
to givwenzen_user
My pleasure. I figured I'd zip up an export and put it on dropbox:
http://dl.dropbox.com/u/4138390/Export%20of%20givwenzen-spring.zip.
Feel free to make it a bit more accessible. In addition to
transactions, I also added a simple little class called StepState to
make sharing state between step classes easier. The project has a
cocoon spring configurator dependency. StepState just gets added to a
spring context. The fixture that does the transaction rollback also
clears the step state. Then in our domain steps, we just @Autowire
that StepState instance from the context.

I'm sure it's not perfect. Ideally the begin/rollback would be a bit
more transparent. Feedback is welcome.

Chuck

szczepiq

unread,
Mar 23, 2010, 12:50:26 PM3/23/10
to givwenz...@googlegroups.com
Cool, thanks.

Your suite.SetUp is:

|Spring Giv Wen Zen For Slim|
|begin|

and suite.TearDown is:

|Spring Giv Wen Zen For Slim|
|rollback|

Do I get it right?

Cheers,
Szczepan

To unsubscribe from this group, send email to givwenzen_user+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

after_thought

unread,
Mar 24, 2010, 8:37:53 AM3/24/10
to givwenzen_user
So far i just have begin/rollback on my test page. But yeah, it makes
sense to put them in setup/teardown.

Chuck

Reply all
Reply to author
Forward
0 new messages