Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Exception "State was never stored from db"

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Exception "State was never stored from db"


Chronological Thread 
  • From: Colin Hudler <>
  • To: Grouper Users Mailing List <>
  • Subject: Re: [grouper-users] Exception "State was never stored from db"
  • Date: Mon, 08 Jun 2009 11:50:18 -0500

I have attached the script; yes, it is written in jruby.

On 6/8/09 11:35 AM, Chris Hyzer wrote:
What is the script?  Im sorry you are having this problem.  In 1.5 things don't work like this (don't update the last changed column for membership change) so the error wont happen.  However, as you say, it is curious that you got this error...

Thanks,
Chris

  
-----Original Message-----
From: Colin Hudler []
Sent: Monday, June 08, 2009 12:27 PM
To: 
Subject: [grouper-users] Exception "State was never stored from db"

I have a small script that takes a single stem argument and uses the
grouper API to obliterate all of it's children and the stem.  I use it
rarely, but it is very simple, and always worked.  Today, I got a
curious error message, and I wonder if it reveals a more serious
problem.  The stem I was obliterating had about 1000 sub-stems, and it
removed those, but the error happened when it tried to remove the last
stem.  I ran it again and it was successful.  I am not highly worried
about this, just thought I'd toss it out there.  It is grouper 1.4.1.

Complete Java stackTrace
java.lang.RuntimeException: State was never stored from db,
Problem in HibernateSession: HibernateSession: isNew: true, isReadonly:
false, grouperTransactionType: READ_WRITE_NEW
         at
edu.internet2.middleware.grouper.Stem.dbVersionDifferentFields(Stem.jav
a:2073)
         at
edu.internet2.middleware.grouper.Stem.onPreUpdate(Stem.java:2022)
         at
edu.internet2.middleware.grouper.hibernate.ByObject.update(ByObject.jav
a:336)
         at
edu.internet2.middleware.grouper.internal.dao.hib3.Hib3StemDAO$5.callba
ck(Hib3StemDAO.java:674)
         at
edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHib
ernateSession(HibernateSession.java:385)
         at
edu.internet2.middleware.grouper.internal.dao.hib3.Hib3StemDAO.revokePr
iv(Hib3StemDAO.java:667)
         at
edu.internet2.middleware.grouper.GrouperNamingAdapter.revokePriv(Groupe
rNamingAdapter.java:323)
         at
edu.internet2.middleware.grouper.privs.NamingWrapper.revokePrivilege(Na
mingWrapper.java:173)
         at
edu.internet2.middleware.grouper.privs.GrouperAllNamingResolver.revokeP
rivilege(GrouperAllNamingResolver.java:126)
         at
edu.internet2.middleware.grouper.privs.GrouperSystemNamingResolver.revo
kePrivilege(GrouperSystemNamingResolver.java:124)
         at
edu.internet2.middleware.grouper.privs.CachingNamingResolver.revokePriv
ilege(CachingNamingResolver.java:170)
         at
edu.internet2.middleware.grouper.privs.WheelNamingResolver.revokePrivil
ege(WheelNamingResolver.java:182)
         at
edu.internet2.middleware.grouper.privs.ValidatingNamingResolver.revokeP
rivilege(ValidatingNamingResolver.java:126)
         at
edu.internet2.middleware.grouper.Stem.revokePriv(Stem.java:930)
         at
edu.internet2.middleware.grouper.Stem$1.callback(Stem.java:1680)
         at
edu.internet2.middleware.grouper.GrouperSession.callbackGrouperSession(
GrouperSession.java:626)
         at
edu.internet2.middleware.grouper.Stem._revokeAllNamingPrivs(Stem.java:1
673)
         at edu.internet2.middleware.grouper.Stem.delete(Stem.java:334)
         at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown
Source)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
rImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
<snip>
    

  

#!/usr/bin/env jruby
#
# This example shows using the Grouper API from JRuby

# WARNING! IT will obliterate all child stems and groups from the stem path
given on the command line!!!

include Java
Dir["/srv/grouper/api/dist/lib/grouper.jar"].each { |jar| require jar }
Dir["/srv/grouper/api/lib/grouper/*.jar"].each { |jar| require jar }

grouper = Java::edu.internet2.middleware.grouper
Stem = grouper.StemFinder
Session =
grouper.GrouperSession.start(grouper.SubjectFinder.find_root_subject)

def delete_groups(stem)
puts "Deleting groups from #{stem.get_name}"
stem.get_child_groups.each { |group| group.delete }
end

def delete_stems(stem)
puts "Deleting stems from #{stem.get_name}"
stem.get_child_stems.each { |stem| delete_groups(stem);delete_stems(stem) }
stem.delete
end

stem = Stem.find_by_name(Session, ARGV[0])
delete_groups(stem)
delete_stems(stem)

Session.stop


Archive powered by MHonArc 2.6.16.

Top of Page