Lawrence,
Thanks for trying this stuff out, it will be helpful for us to figure out the problem since I cant reproduce it.
Im using SQL server 2008, I cleared out the DB, installed the registry, set that property, and it worked fine. I don’t know if the issue is the version of SQL server, or your import from the previous version, not sure.
Can you try the latest grouper api binary (or however you do it), I just tweaked a few things, let me know the stack if you get an error.
Shilen, do you mind reviewing my last commit? Im running the tests again on hsql. I started up Grouper and it autocreated stuff fine. Basically the change is not to read from cache when seeing if things exist. Shilen, do you have any other thoughts about what might be going on?
http://www.internet2.edu/grouper/release/2.0.0/
Thanks!
Chris
From: Klug, Lawrence []
Sent: Tuesday, August 16, 2011 1:52 PM
To: Chris Hyzer
Subject: GrouperStaleObjectStateException
Hi Chris,
Downloaded and rebuilt the project today. Same result – getting stale object error unless the grouper.attribute.loader.autoconfigure is switched off, in which case the exception goes away.
Note: The SQLServer 2005 database was migrated from an earlier project (grouper version 1.3, I believe) - is this a possible issue?
Here is the registry check output:
----------------------------------------------------
C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\bin>gsh -registry -check -runscript
Using GROUPER_HOME: C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\bin\..
Using GROUPER_CONF: C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\bin\../conf
Using JAVA: "C:\Program Files\Java\jdk1.6.0_26/bin/java"
using MEMORY: 64m-512m
Grouper starting up: version: 2.0.0, build date: 2011/08/16 09:17:45, env: grouper2 dev
grouper.properties read from: C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\conf\grouper.properties
Grouper current directory is: C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\bin
log4j.properties read from: C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\conf\log4j.properties
Grouper is logging to file: C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\bin\..\logs\grouper_error.log, at min level WARN for package: edu.internet2.
middleware.grouper, based on log4j.properties
grouper.hibernate.properties: C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\conf\grouper.hibernate.properties
grouper.hibernate.properties:
sources.xml read from: C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\conf\sources.xml
sources.xml groupersource id: g:gsa
sources.xml jndi source id: ldap: uid=lqt,ou=edimi consumers,dc=edtest,dc=ucla,dc=edu@ldap://eds7.ais.ucla.edu:389
sources.xml jdbc source id: jdbc: GrouperJdbcConnectionProvider
(note, might need to type in your response multiple times (Java stdin is flaky))
(note, you can whitelist or blacklist db urls and users in the grouper.properties)
Are you sure you want to schemaexport all tables (dropThenCreate=F,writeAndRunScript=T) in db user 'mi_grouper', db url 'jdbc:jtds:sqlserver://aisdevdb.ais.ucla
.edu:1433/mi_grouper-devtest'? (y|n):
y
Continuing...
NOTE: database table/object structure (ddl) is up to date
C:\Users\lklug\Documents\workspace5\grouper.api-2.0.0\bin
Here is the stale object exception from today:
------------------------------------------------------------
edu.internet2.middleware.grouper.exception.GrouperStaleObjectStateException: Problem in HibernateSession: HibernateSession: isNew: false, isReadonly: false, grouperTransactionType: READ_WRITE_NEW,
Problem in HibernateSession: HibernateSession: isNew: true, isReadonly: false, grouperTransactionType: READ_WRITE_NEW
at edu.internet2.middleware.grouper.hibernate.HibernateSession._internal_hibernateSessionCatch(HibernateSession.java:420)
at edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHibernateSession(HibernateSession.java:510)
at edu.internet2.middleware.grouper.hibernate.ByObjectStatic.saveOrUpdate(ByObjectStatic.java:339)
at edu.internet2.middleware.grouper.internal.dao.hib3.Hib3AttributeDefDAO.saveOrUpdate(Hib3AttributeDefDAO.java:131)
at edu.internet2.middleware.grouper.attr.AttributeDef$1.callback(AttributeDef.java:402)
at edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHibernateSession(HibernateSession.java:500)
at edu.internet2.middleware.grouper.attr.AttributeDef.store(AttributeDef.java:382)
at edu.internet2.middleware.grouper.misc.GrouperCheckConfig.checkAttributes(GrouperCheckConfig.java:1567)
at edu.internet2.middleware.grouper.misc.GrouperCheckConfig.checkConfig(GrouperCheckConfig.java:420)
at edu.internet2.middleware.grouper.misc.GrouperStartup.startup(GrouperStartup.java:109)
at edu.internet2.middleware.grouper.ui.GrouperUiFilter.init(GrouperUiFilter.java:613)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:287)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [edu.internet2.middleware.grouper.attr.AttributeDef#ff7183702873412d9265ad4e30fbc7d3],
Exception in save: edu.internet2.middleware.grouper.attr.AttributeDef, : [edu.internet2.middleware.grouper.attr.AttributeDef#ff7183702873412d9265ad4e30fbc7d3]
at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2412)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at edu.internet2.middleware.grouper.hibernate.ByObject.saveOrUpdate(ByObject.java:362)
at edu.internet2.middleware.grouper.hibernate.ByObjectStatic$5.callback(ByObjectStatic.java:352)
at edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHibernateSession(HibernateSession.java:500)
... 27 more
Lawrence Klug
Grouper Integration
UCLA Middleware Services
Office: 310 825-2061
Cell: 818 667-2386