Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <code>HibernateException</code> is thrown because there isn't a transaction in progress.</p> <p>The <code>@Transactional</code> on <code>FacebookControllerHelper.getUserLikes(Token accessToken, Users user)</code> won't work. Spring uses <a href="http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/transaction.html#tx-decl-explained" rel="nofollow">proxies</a> to implement to transactional behavior. But in order for this to work, the lifecycle of the <code>FacebookControllerHelper</code> should be managed by spring, which is not the case as Quartz instantiates the <code>FacebookControllerHelper</code> job. You could use <a href="http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/transaction.html#transaction-declarative-aspectj" rel="nofollow">aspectj</a> to proxy objects managed outside of spring, but this probably a bit to complicated for your use case.</p> <p>The real problem is probably that neither your service or dao is transactional. The facebook service and dao are probably managed by spring, so you should make at least the dao or service <a href="http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/transaction.html#transaction-declarative-annotations" rel="nofollow">transactional</a>. Declaring transactions on your service layer is a good practice anyway.</p> <p>If you really want to make the <code>FacebookControllerHelper</code> transactional,you should use aspectj, use a <code>TransactionTemplate</code> or let spring manage the lifecycle of your jobs by configuring a custom <code>SchedulerFactory</code>.</p>
 

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