tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Luis Sanchez <joseluis.sanc...@m-centric.com>
Subject Re: Updating Hibernate Entites
Date Mon, 08 Feb 2010 09:21:09 GMT
You are trying to save  a new object while using the old object id , 
what would end in two entities with same id - something not possible.
You should  call your DAO update method , instead of save.


> Hello List,
>
>
>
> i'm trying to update an Hibernate-Object but alway get an "a different object with the
same identifier value was already associated with the session:" Exception.
>
>
>
> My Form-Code looks like:
>
> @Inject
>
>        private ConfigurationDAO configDAO;
>
> @Persist
>
>        @Property
>
>        private Configuration config;
>
>
>
>        void onSuccessFromConfigForm(){
>
>              config.setEditDate(new Date());
>
>              configDAO.doSave(config);
>
>        }
>
>
>
>        void onActivate(Long configId){
>
>              config=configDAO.doRetrieve(configId,false);
>
>        }
>
>        void onActivate(){
>
>              configs = configDAO.findAll();
>
>              if(config==null)
>
>                    config=new de.leomedia.leotipp.model.Configuration();
>
>        }
>
>
>
> can anyone give me a lead into the right direction?
>
>
>
> thanks, Dominik
>
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Mime
View raw message