-
15. Re: Using saveOrUpdate()
gavin.king Oct 17, 2005 8:40 AM (in response to nusa)Well, sorry, but you'll need to simplify things before I can help you any further. It seems that your problem is in trying to get everything to work in one big bang instead of starting with the examples included in the Seam download and working from there, one step at a time.
-
16. Re: Using saveOrUpdate()
nusa Oct 19, 2005 7:24 PM (in response to nusa)"gavin.king@jboss.com" wrote:
Submit a runnable zip of your project to JIRA, and I will take a quick look.
Done, it's JBSEAM-96.
Thanks. -
17. Re: Using saveOrUpdate()
xiangya Oct 20, 2005 1:19 AM (in response to nusa)hi,
try to add a little modification and remove @In
and @Out annotation at project field.
maybe you have no need to inout project field with
other control action object. -
18. Re: Using saveOrUpdate()
nusa Oct 20, 2005 5:21 AM (in response to nusa)"xiangya" wrote:
hi,
try to add a little modification and remove @In
and @Out annotation at project field.
maybe you have no need to inout project field with
other control action object.
Hi,
I need @In in order to 'save' or 'insert' the data, otherwise it won't.
I tried to remove @Out, put it back, specify the values, etc, yet it still
won't update. I don't have any more idea. -
19. Re: Using saveOrUpdate()
nusa Oct 28, 2005 9:30 AM (in response to nusa)Gavin,
Any chance you will take a look at JBSEAM-96 ?
Thanks. -
20. Re: Using saveOrUpdate()
xiangya Nov 2, 2005 1:07 AM (in response to nusa)hi,
checked your code, you use local var "project" in ProjectAction, but you did not assigned value for it,just use @In(created=true), so every value of project var is always new Project.
pls see note between two lines//////////////////////////@IfInvalid(outcome=REDISPLAY) public String markForEdition() { log.info("=== markForEdition ..."); log.info("=== get dataAction ..."); DataAction data = (DataAction)Contexts.getEventContext().get("dataAction"); //log.info("=== The obj is " + data.getClass().getName()); UIData table = data.getTable(); //CoreTable table = data.getTable(); if ( table.isRowAvailable() ) { ////////////////////// at this maybe you want proejct=(Project)table.getRowData(); ////////////////////// Project prj = (Project) table.getRowData(); log.info("=== Attempting to update a row : " + prj.toString()); prj = (Project)hibernateSession.merge(prj); //hibernateSession.update(project); //hibernateSession.saveOrUpdate(prj); return "success"; } else { log.info("=== Couldn't find row !!!"); } return null; }
-
21. Re: Using saveOrUpdate()
nusa Nov 2, 2005 6:29 AM (in response to nusa)I already did that combination, but still not working (not commited in the database ).
-
22. Re: Using saveOrUpdate()
svetsch Nov 23, 2005 5:24 PM (in response to nusa)Did you solve your problem ?
I'm having the same problem, but only if I do an update in a CONVERSATION scope, where I'm trying to update an object that was loaded and changed in a previous request but in the same conversation. If my controller is in the EVENT scope, everything works well (ChangePasswordAction) in noEJB booking example.
In other words,
This is not working, i.e. no database update is done@End public String update() { portfolio = (AmcPortfolio)session.merge(portfolio); return "main"; }
I get the following message :(DefaultMergeEventListener.java:entityIsPersistent:124) -ignoring persistent instance
But this is working (no business meaning, but interesting):@End public String update() { session.refresh(portfolio); portfolio.setPortfolioName("TEST"); portfolio = (AmcPortfolio)session.merge(portfolio); return "main"; }
Any help welcome !