Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing and controlling Spring transactions within Struts 2 actions
    primarykey
    data
    text
    <p>Hey guys, I have been working for a while on a project with the following components:</p> <ul> <li>Struts2.1.8.1,</li> <li>Spring 3.0.3</li> <li>JPA 2.0,</li> <li>Hibernate 3</li> </ul> <p>I am using Spring's EntityManager magic... But I'm having problems dealing with transactions inside my actions. For instance, I am setting values on my persisted object in several methods within my class, and I want to be able to <code>rollback</code> if the <code>validate</code> method finds a validation error, or <code>commit</code> these changes otherwise. I have already spent quite a long time reading half of the internet for a comprehensive explanation. Unfortunately, no complete examples exist (at least similar to my stack).</p> <p>I have stumbled with this thread on a mailing list: <a href="http://mail-archives.apache.org/mod_mbox/struts-user/200905.mbox/%3C4A038DAE.6060200@it-neering.net%3E" rel="nofollow">@Transactional Spring Annotation in a Struts2 Action does not work</a>. The message I'm linking at seems to have a pretty simple and straightforward solution, using a <code>TransactionInterceptor</code> will do the trick it seems... The problem is that I'm not finding useful information regarding this interceptor.</p> <p>Anyone here has experience with this technology and can spare a tip and a link or two on how to use Spring transactions inside Struts2 actions?</p> <p>Thanks!</p> <p><strong>- Edit 1 -</strong></p> <p>I have set up a test project if you are interested, just <a href="http://pynfo.com/misc/PersistencyTest.zip" rel="nofollow">download the file</a> and try it out (or inspect it). Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload