Hi,
I have problems in persisting objects to the database. Not all objects in my application are having this problem just a few of them. And the most discussing thing is that earlier they did not have this problem.
The effect occures with insert and update.
Im developing with different connection to the database but all of them have the same rights. And just to be sure I tried also the other database usersaccount with no success.
I should mention that I'm using Spring Framework in my project.
Thanks in advance for your help!
Hibernate version: 2.1.6
Code between sessionFactory.openSession() and session.close():
SpringContextAccessor springCtxAccessor = new SpringContextAccessor();
AccountabilityService accountService = (AccountabilityService) springCtxAccessor.aquireBean(ACCOUNTABILITY_SERVICE, data);
CriteriaService criteriaService = (CriteriaService) springCtxAccessor.aquireBean(CRITERIA_SERVICE, data);
CriteriaTracker criteriaTracker = criteriaService.getTracker();
LOGGER.debug("-------- BEGIN UPDATE --------");
Criteria criteria = criteriaTracker.findByPrimaryKey(data.getParameters().getLong("criteriaId"));
CustomerGroup customerGroup = accountService.getTracker().findGroupByPrimaryKey(data.getParameters().getLong("customerGroupId"));
if (customerGroup != null) {
criteria.setCustomerGroup(customerGroup);
}
criteria.setDescription(data.getParameters().getString("description"));
criteriaService.update(criteria);
LOGGER.debug("-------- END UPDATE --------");
Name and version of the database you are using: PostgreSQL 7.4.3
Spring version: 1.0.2
Debug level Hibernate log excerpt:
[2004-09-29 14:03:23,993] DEBUG application.modules.actions.backoffice.survey.CriteriaAction - -------- BEGIN UPDATE --------
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.impl.SessionImpl - loading [application.domain.model.transaction.selection.Criteria#6]
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.impl.SessionImpl - loading [application.domain.model.master.CustomerGroup#1]
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.impl.SessionImpl - attempting to resolve [application.domain.model.master.CustomerGroup#1]
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.impl.SessionImpl - object not resolved in any cache [application.domain.model.master.CustomerGroup#1]
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.persister.EntityPersister - Materializing entity: [application.domain.model.master.CustomerGroup#1]
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.SQL - select customergr0_.id as id0_, customergr0_.REVISION as REVISION0_, customergr0_.NAME as NAME0_ from CUSTOMER_GROUP customergr0_ where customergr0_.id=?
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.impl.BatcherImpl - preparing statement
[2004-09-29 14:03:23,993] DEBUG net.sf.hibernate.type.LongType - binding '1' to parameter: 1
[2004-09-29 14:03:24,003] DEBUG net.sf.hibernate.loader.Loader - processing result set
[2004-09-29 14:03:24,003] DEBUG net.sf.hibernate.loader.Loader - result row: 1
[2004-09-29 14:03:24,003] DEBUG net.sf.hibernate.loader.Loader - Initializing object from ResultSet: 1
[2004-09-29 14:03:24,003] DEBUG net.sf.hibernate.loader.Loader - Hydrating entity: application.domain.model.master.CustomerGroup#1
[2004-09-29 14:03:24,003] DEBUG net.sf.hibernate.type.LongType - returning '16' as column: REVISION0_
[2004-09-29 14:03:24,003] DEBUG net.sf.hibernate.type.StringType - returning '
|