Getting rollback error in JPA when deploying to smartfox

80 Views Asked by At

Possible Duplicate:
JPA RollbackException but not in unit test

I have an issue that is not present when running a unit test using JPA 2.0, but if I try to use this functionality within a handler I get an exception.

ie this works fine - I can verify the change in the database

    LevelDAO dao = new LevelDAO();
    List levels = dao.findAll();
    int i = levels.size();
    Level l = (Level) levels.get(i-1);
    l.setName("bla");
    EntityManagerHelper.beginTransaction();
    dao.update(l);
    EntityManagerHelper.commit();

When I try to deploy this to a handler (Smartfox Extension) I receive a rollback exception:

save successful <-- (i receive this msg in both cases)

However for my Smartfox deployment...

ie. MySQLIntegrityConstraintViolationException : column 'levelid' cannot be null Query: UpdateObjectQuery(com.abc.model.Layer@10ae6fc)

Which is run from

public class SetModelHandler extends BaseClientRequestHandler

@Override
public void handleClientRequest(User sender, ISFSObject params)

The database change doesnt happen. I'm able to read the base fine from within this handler. Anyone have any ideas about how to pursue this?

Ta,

0

There are 0 best solutions below