Problem Flex + JPA entity Manager flush
I have a problem with a @transactional(readOnly=false) method, into a @Service class exposed to flex with @RemotingDestination
this class has two methods.
- One read from a dataSource through a @Repository dao class.
- And Other who writes to the database through the same dao.
The reading of the entities from flex client is ok. But the problem is when i need to persist. At the moment of flush the method stop, fail in flex and don't show any exception in java stacktrace. (the db don't save anything too)
i have in the service, code likes this:
Code:
@Service("fooService")
@RemotingDestination
public class FooService() {
@Autowired
private GenericDao genericDao;
@Transactional(readOnly=false)
@RemoteInclude
public void methodWhoPersist(Dog entity) {
...
try{
genericDao.save(entity);
}catch(Exception ex) {
ex.printstacktrace();
throw new RuntimeException("error in save method");
}
...
}
}
in the DAO, for testing purpose is there a flush after persist.
Code:
...
em.persist(entity);
em.flush();
...
Another thing is when call the service from other spring bean, the method who write works ok. This not work only with the flex call.
I'm using JPA/HIBERNATE 3, SPRING 3.0.5
Sorry for my English, is not my native language.
heeelp :confused: