struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piero Sartini <li...@pierosartini.de>
Subject Re: ModelDriven CRUD validation failure still causes JPA update
Date Mon, 01 Oct 2007 21:38:20 GMT
> Since my Model is acquired from the Hibernate session (during the
> "prepare()" Action method), it is a transactional persistent instance.
> Note this from the hibernate documentation:
>
> "Transactional persistent instances (ie. objects loaded, saved, created or
> queried by the Session) may be manipulated by the application and any
> changes to persistent state will be persisted when the Session  is flushed
> (discussed later in this chapter). There is no need to call a particular
> method (like update(), which has a different purpose) to make your
> modifications persistent."

I do not know hibernate but you could try the following solutions:

* don't flush the session and destroy the object

* instantiate a temporary bean used for the form only:
BeanUtils.copyProperties(tempBean, yourBean);

* manage your entities with JPA's EntityManager, merge them manually.

Piero

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message