title: Wicket with Spring declarative transaction
body: <p>It is  possible to use the Spring Framework's @Transactional support outside of a Spring container. In reference documentation is chapter about AspectJ aspect. I'm trying to use it in my wicket application, but with no positive result.</p>
  
  <p>application-context.xml:
      
          
          
      </p>
  
  <pre><code>&lt;tx:annotation-driven transaction-manager="transactionManager" mode="aspectj" /&gt;
  &lt;context:annotation-config /&gt;
  &lt;context:component-scan base-package="com.wicket.app"/&gt;
  &lt;context:spring-configured /&gt;
  
  &lt;bean id="annotationTransactionAspect" factory-method="aspectOf"
        class="org.springframework.transaction.aspectj.AnnotationTransactionAspect"&gt;
      &lt;property name="transactionManager" ref="transactionManager"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>In my form class annotated by @Configurable, I have:</p>
  
  <pre><code>@Transactional
  public void process(IFormSubmittingComponent submittingComponent) {
      super.process(submittingComponent);
      getDao().getEntityManager().flush();
  }
  </code></pre>
  
  <p>Stack trace:</p>
  
  <pre><code>org.apache.openjpa.persistence.TransactionRequiredException: Can only perform operation while a transaction is active.
  </code></pre>