Bug #778 (closed)
Opened 12 years ago
Closed 12 years ago
Save and Return
| Reported by: | jburel | Owned by: | jamoore |
|---|---|---|---|
| Priority: | critical | Cc: | jburel, cxallan, dsloan@… |
| Sprint: | n.a. | ||
| Total Remaining Time: | n.a. |
Description
Trying to update a project, new problem. Connected to valewalker
Follow the error
ome.conditions.InternalException: Wrapped Exception: (org.springframework.orm.hibernate3.HibernateJdbcException): JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.SQLGrammarException: could not initialize a collection: [ome.model.containers.Project.annotations#2] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:636) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:408) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367) at org.springframework.orm.hibernate3.HibernateTemplate.merge(HibernateTemplate.java:752) at ome.logic.UpdateImpl.internalSave(UpdateImpl.java:240) at ome.logic.UpdateImpl$5.run(UpdateImpl.java:132) at ome.logic.UpdateImpl$5.run(UpdateImpl.java:131) at ome.logic.UpdateImpl.doAction(UpdateImpl.java:271) at ome.logic.UpdateImpl.saveAndReturnObject(UpdateImpl.java:129) at ome.logic.PojosImpl.updateDataObject(PojosImpl.java:458)
Change History (6)
comment:1 Changed 12 years ago by jmoore
- Milestone changed from 3.0-Beta3 to 3.0-Beta2.2
comment:2 Changed 12 years ago by jmoore
- Status changed from new to assigned
comment:3 Changed 12 years ago by jburel
Tested again server with Beta 2 version installed and JBOSS 4.0.$
comment:4 Changed 12 years ago by jmoore
- Cc callan dsloan@… added
Sorry, missed the valewalker reference above. Weird:
- old hibernate and jboss, so no change there
- only thing that's somewhat interesting is that the table belongs to Chris:
public | projectannotation | table | callan public | projectdatasetlink | table | omero public | pulse | table | omero public | quantumdef | table | omero public | region | table | omero
but that shouldn't really matter. We'll need to find out when this started happening and what changed to know what's what.
comment:5 Changed 12 years ago by jburel
Tested the call using this time Warlock. And seems to work.
comment:6 Changed 12 years ago by jmoore
- Resolution set to fixed
- Status changed from assigned to closed
Let's reopen if this arises again.
Hey J-M.
So, I did the following to reproduce this:
public void test_ProjAnnCollectionError() throws Exception { Project p = new Project(); p.setName("ticket:778"); p = sf.getPojosService(). createDataObject(p, new PojoOptions().map()); Project fromServer = sf.getQueryService().get(Project.class,p.getId()); fromServer.setDescription("desc updated"); fromServer.accept(new CollectionUnloader()); sf.getPojosService().updateDataObject(fromServer, new PojoOptions().map()); }But it works. What box are you running this against so I can look at
the DB? Also which versions are being run? JBoss 4.0.4 still?
jean-marie writes:
> public DataObject updateDataObject(DataObject object) > throws DSOutOfServiceException, DSAccessException > { > if (object == null) > throw new DSAccessException("No object to update."); > IObject ho = null; > IObject oldObject = null; > oldObject = object.asIObject(); > ho = gateway.findIObject(oldObject); //make sure the object > is current. > > if (ho == null) return null; > ModelMapper.fillIObject(oldObject, ho); //set name and > description > ModelMapper.unloadCollections(ho); //unload collections > IObject updated = gateway.updateObject(ho, > (new PojoOptions()).map()); > return PojoMapper.asDataObject(updated); > }