I know this isn't Gaelyk specific, but I am using Gaelyk with Spring
and having some problems...
I obtain a Spring service bean via WebApplicationContextUtils that
does some stuff with the datastore.
The problem I am having is that when my service is a Java file, Spring
honors the @Transactional annotation. But, as soon as I rename my
service bean to .groovy, @Transactional no longer works.
Anyone have any idea why this might be happening?
This is my service method:
@Transactional
public User findUser(Long id) {
if (id == null) return null;
Query query = entityManager().createQuery("SELECT o FROM User
o WHERE
o.id = :id").setParameter("id", id);
User result = null;
List results = query.getResultList();
if (results.size() > 0) {
result = (User) results.get(0);
}
return result;
}
Like I said, when it is Java, it works fine, but once it is a groovy
file, I get some sort of session closed exception when it gets to
results.size()