-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: my objects are not getting persisted
PostPosted: Thu Sep 25, 2003 12:26 pm 
Newbie

Joined: Thu Sep 25, 2003 11:04 am
Posts: 6
Location: Charleston, SC
I'm having trouble getting hibernate to persist my objects. I have hunted through the faq's and some forums and have not seen anything similar to this. My setup is as follows.

I'm using hibernate withing a stateless session bean using CMT with Weblogic 8.1. I have methods createObject, saveObject, etc that is supposed to perform the specified action on the object using hibernate.

I am initializing hibernate in the ejbCreate() method of the bean. The mapping files are generated by xdoclet and I successfully had schema export a script and create my tables. I first tried configuring the Configuration with hibernate.cfg.xml. That appeared to initialize hibernate, but would not save objects. What is below is the latest incarnation of what I have tried.
Code:
    private SessionFactory sessionFactory;
    public void ejbCreate() throws CreateException {
        log = LogFactory.getLog(HibernatePersistenceEngineBean.class);
        try {
            sessionFactory = getSessionFactory();
        } catch (Exception e) {
            throw new CreateException("Error creating SessionFactory for Hibernate. " + e.getMessage());
        }
    }

    protected SessionFactory getSessionFactory() throws Exception {
        InitialContext ctx = new InitialContext();
        SessionFactory factory = null;
        try {
            factory = (SessionFactory) ctx.lookup("hibernate-session-factory");
        } catch (NameNotFoundException e) {
            Configuration config = new Configuration()
                    .addClass(org.scra.emall.rule.RuleDefinition.class)
                    .addClass(org.scra.emall.rule.ConditionDefinition.class)
                    .addClass(org.scra.emall.rule.ObjectOperand.class)
                    .addClass(org.scra.emall.rule.ValueOperand.class);
            factory = config.buildSessionFactory();
            ctx.rebind("hibernate-session-factory", factory);
        }
        return factory;
    }



This appears to work fine. Hibernate spits out some logs saying it initialized the objects, etc.

I wrote a simple test to try to save an object. I just programatically create that object in a class with a main method, set some property values, add one child and call the save method on the stateless bean.
Code:
    public Object saveObject(Object object) throws PersistenceEngineException {
        log.info("Trying to saveObject " + object.getClass().toString());
        Session session = null;
        try {
            session = sessionFactory.openSession();
            session.saveOrUpdate(object);
            return object;
        } catch (HibernateException e) {
            ctx.setRollbackOnly();
            throw new PersistenceEngineException("Error saving object: " + object.toString());
        } finally {
            try {
                releaseSession(session);
            } catch (HibernateException e) {
                // do nothing
            }
        }
    }

    protected void releaseSession(Session aSession) throws HibernateException {
        if (aSession != null) {
            aSession.flush();
            aSession.close();
        }
    }




I'm not sure where to procede at this point. Any pointers are greatly appreciated. More info below.

Logging that is dumped by hibernate:
Code:
Sep 25, 2003 10:58:23 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.0.3
Sep 25, 2003 10:58:23 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.cglib.use_reflection_optimizer=true, hibernate.jdbc.use_streams_for_b
inary=true, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.show_sql=false, hibernate.jdbc.batch_size=0, hibernate.conne
ction.datasource=ruleDS}
Sep 25, 2003 10:58:23 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: using java.io streams to persist binary types
Sep 25, 2003 10:58:23 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Sep 25, 2003 10:58:23 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: JVM proxy support: true
Sep 25, 2003 10:58:23 AM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: org/scra/emall/rule/RuleDefinition.hbm.xml
Sep 25, 2003 10:58:23 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.scra.emall.rule.RuleDefinition -> rule_def
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: org/scra/emall/rule/ConditionDefinition.hbm.xml
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.scra.emall.rule.ConditionDefinition -> rule_condition_def
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: org/scra/emall/rule/ObjectOperand.hbm.xml
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.scra.emall.rule.ObjectOperand -> rule_condition_object_operand
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: org/scra/emall/rule/ValueOperand.hbm.xml
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.scra.emall.rule.ValueOperand -> rule_condition_value_operand
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: org.scra.emall.rule.RuleDefinition.ruleConditions -> rule_condition_def
Sep 25, 2003 10:58:24 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Sep 25, 2003 10:58:24 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Sep 25, 2003 10:58:24 AM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.OracleDialect
Sep 25, 2003 10:58:24 AM net.sf.hibernate.util.NamingHelper getInitialContext
INFO: JNDI InitialContext properties:{}
Sep 25, 2003 10:58:24 AM net.sf.hibernate.connection.DatasourceConnectionProvider configure
INFO: Using datasource: ruleDS
Sep 25, 2003 10:58:24 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: Use outer join fetching: true
Sep 25, 2003 10:58:24 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: Use scrollable result sets: true
Sep 25, 2003 10:58:25 AM net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: no JDNI name configured
Sep 25, 2003 10:58:25 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: Query language substitutions: {}


hibernate.properties
Code:
hibernate.connection.datasource = ruleDS
hibernate.dialect = net.sf.hibernate.dialect.OracleDialect


Top
 Profile  
 
 Post subject: Answer
PostPosted: Thu Sep 25, 2003 1:04 pm 
Beginner
Beginner

Joined: Wed Aug 27, 2003 6:44 pm
Posts: 20
Do the commit after the flush


Top
 Profile  
 
 Post subject: Commit after flush
PostPosted: Thu Sep 25, 2003 1:23 pm 
Newbie

Joined: Thu Sep 25, 2003 11:04 am
Posts: 6
Location: Charleston, SC
it was my understanding from the FAQ's that because this bean uses CMT, the container handled the transactions and all i had to do was call flush() & close()


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2003 4:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Enabled logging and SQL output to see what hibernate is doing.
hibernate.show_sql=true
I did not see the log message you have added to the method so don't now if its being called. Your on the right track so keep playing around and have a look at some examples.

CMT does not requre the commit as the container provides this service.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2003 3:01 pm 
Newbie

Joined: Thu Sep 25, 2003 11:04 am
Posts: 6
Location: Charleston, SC
Changed hibernate log level to debug and turned on show_sql. Running same test, here is what I get.

I appears that the oracle id sequencer is running, but still no data getting saved.

Code:
14:48:36,765  INFO Environment:403 - Hibernate 2.0.3
14:48:36,765  INFO Environment:437 - loaded properties from resource hibernate.properties: {hibernate.cglib.use_reflection_optimizer=true, h
ibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.show_sql=true, hibernate.connection.datasource=ruleDS}
14:48:36,781  INFO Environment:452 - using CGLIB reflection optimizer
14:48:36,781  INFO Environment:462 - JVM proxy support: true
14:48:36,781  INFO Configuration:283 - Mapping resource: org/scra/emall/rule/RuleDefinition.hbm.xml
14:48:36,937 DEBUG DTDEntityResolver:20 - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net
/sf/hibernate/
14:48:36,937 DEBUG DTDEntityResolver:29 - found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
14:48:37,171  INFO Binder:178 - Mapping class: org.scra.emall.rule.RuleDefinition -> rule_def
14:48:37,359 DEBUG Binder:394 - Mapped property: id -> id, type: integer
14:48:37,390 DEBUG Binder:394 - Mapped property: name -> rule_name, type: string
14:48:37,406 DEBUG Binder:394 - Mapped property: action -> action, type: string
14:48:37,406 DEBUG Binder:394 - Mapped property: creationDate -> creation_date, type: timestamp
14:48:37,406 DEBUG Binder:394 - Mapped property: email -> email, type: string
14:48:37,406 DEBUG Binder:394 - Mapped property: errorMessage -> error_message, type: string
14:48:37,453 DEBUG Binder:394 - Mapped property: ruleConditions, type: java.util.Set
14:48:37,453  INFO Configuration:283 - Mapping resource: org/scra/emall/rule/ConditionDefinition.hbm.xml
14:48:37,468 DEBUG DTDEntityResolver:20 - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net
/sf/hibernate/
14:48:37,468 DEBUG DTDEntityResolver:29 - found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
14:48:37,484  INFO Binder:178 - Mapping class: org.scra.emall.rule.ConditionDefinition -> rule_condition_def
14:48:37,484 DEBUG Binder:394 - Mapped property: id -> id, type: integer
14:48:37,484 DEBUG Binder:394 - Mapped property: operatorSymbol -> operatorSymbol, type: string
14:48:37,500 DEBUG Binder:394 - Mapped property: objectOperand, type: org.scra.emall.rule.ObjectOperand
14:48:37,500 DEBUG Binder:394 - Mapped property: valueOperand, type: org.scra.emall.rule.ValueOperand
14:48:37,500  INFO Configuration:283 - Mapping resource: org/scra/emall/rule/ObjectOperand.hbm.xml
14:48:37,500 DEBUG DTDEntityResolver:20 - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net
/sf/hibernate/
14:48:37,515 DEBUG DTDEntityResolver:29 - found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
14:48:37,531  INFO Binder:178 - Mapping class: org.scra.emall.rule.ObjectOperand -> rule_condition_object_operand
14:48:37,531 DEBUG Binder:394 - Mapped property: id -> id, type: integer
14:48:37,531 DEBUG Binder:394 - Mapped property: objectClass -> object_class, type: string
14:48:37,531 DEBUG Binder:394 - Mapped property: identifier -> identifier, type: string
14:48:37,531 DEBUG Binder:394 - Mapped property: objectProperty -> object_property, type: string
14:48:37,531  INFO Configuration:283 - Mapping resource: org/scra/emall/rule/ValueOperand.hbm.xml
14:48:37,546 DEBUG DTDEntityResolver:20 - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net
/sf/hibernate/
14:48:37,546 DEBUG DTDEntityResolver:29 - found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
14:48:37,562  INFO Binder:178 - Mapping class: org.scra.emall.rule.ValueOperand -> rule_condition_value_operand
14:48:37,578 DEBUG Binder:394 - Mapped property: id -> id, type: integer
14:48:37,578 DEBUG Binder:394 - Mapped property: objectValue -> objectValue, type: string
14:48:37,578  INFO Configuration:492 - processing one-to-many association mappings
14:48:37,578 DEBUG Binder:1134 - Second pass for collection: org.scra.emall.rule.RuleDefinition.ruleConditions
14:48:37,578  INFO Binder:1025 - Mapping collection: org.scra.emall.rule.RuleDefinition.ruleConditions -> rule_condition_def
14:48:37,578 DEBUG Binder:1146 - Mapped collection key: rule_id, one-to-many: org.scra.emall.rule.ConditionDefinition
14:48:37,578  INFO Configuration:503 - processing foreign key constraints
14:48:37,593 DEBUG Configuration:513 - resolving reference to class: org.scra.emall.rule.RuleDefinition
14:48:37,828  INFO SessionFactoryImpl:132 - building session factory
14:48:37,828 DEBUG SessionFactoryImpl:134 - instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., org.xml.sax.p
arser=weblogic.xml.jaxp.RegistryParser, os.name=Windows XP, sun.boot.class.path=D:\bea\JDK141~1\jre\lib\rt.jar;D:\bea\JDK141~1\jre\lib\i18n.
jar;D:\bea\JDK141~1\jre\lib\sunrsasign.jar;D:\bea\JDK141~1\jre\lib\jsse.jar;D:\bea\JDK141~1\jre\lib\jce.jar;D:\bea\JDK141~1\jre\lib\charsets
.jar;D:\bea\JDK141~1\jre\classes, sun.java2d.fontpath=, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.4.1_03-b0
2, weblogic.Name=myserver, jmx.implementation.vendor=Sun Microsystems, user.name=doug, jmx.implementation.name=JMX RI, user.language=en, jav
a.naming.factory.initial=weblogic.jndi.WLInitialContextFactory, sun.boot.library.path=D:\bea\JDK141~1\jre\bin, jmx.specification.name=Java M
anagement Extensions, java.version=1.4.1_03, user.timezone=America/New_York, sun.arch.data.model=32, javax.rmi.CORBA.UtilClass=weblogic.iiop
.UtilDelegateImpl, jmx.specification.version=1.0 Final Release, java.endorsed.dirs=D:\bea\JDK141~1\jre\lib\endorsed, vde.home=.\myserver\lda
p, sun.cpu.isalist=pentium i486 i386, jmx.implementation.version=1.0, file.encoding.pkg=sun.io, weblogic.mbeanLegalClause.ByPass=false, file
.separator=\, java.specification.name=Java Platform API Specification, hibernate.cglib.use_reflection_optimizer=true, java.class.version=48.
0, user.country=US, java.home=D:\bea\JDK141~1\jre, java.vm.info=mixed mode, os.version=5.1, log4j.config=log4j.properties, hibernate.connect
ion.datasource=ruleDS, org.omg.CORBA.ORBSingletonClass=weblogic.corba.orb.ORB, path.separator=;, java.vm.version=1.4.1_03-b02, java.util.pre
fs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, user.variant=, java.protocol.handler.pkgs=weblogic.utils|weblogic.utils|web
logic.net, jmx.specification.vendor=Sun Microsystems, java.awt.printerjob=sun.awt.windows.WPrinterJob, java.security.policy=D:\bea\WEBLOG~1\
server\lib\weblogic.policy, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, java.naming.factory.url.pkgs=weblog
ic.jndi.factories:weblogic.corba.j2ee.naming.url, user.home=C:\Documents and Settings\doug, java.specification.vendor=Sun Microsystems Inc.,
org.xml.sax.driver=weblogic.apache.xerces.parsers.SAXParser, java.library.path=D:\bea\JDK141~1\bin;.;C:\WINDOWS\System32;C:\WINDOWS;D:\bea\
WEBLOG~1\server\bin;D:\bea\JDK141~1\jre\bin;D:\bea\JDK141~1\bin;C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system3
2;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;c:\bin\vslick\win;D:\bea\jdk141_03\bin;C:\Program
Files\SSH Communications Security\SSH Secure Shell;C:\Program Files\GNU\WinCvs 1.3\CVSNT;C:\cygwin;C:\bin\maven-1.0-beta-10\bin;C:\bin;D:\be
a\WEBLOG~1\server\bin\oci920_8, java.vendor.url=http://java.sun.com/, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=net.sf.hiberna
te.dialect.OracleDialect, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=D:\bea\JDK141~1\lib\tools.jar;
D:\bea\WEBLOG~1\server\lib\weblogic_sp.jar;D:\bea\WEBLOG~1\server\lib\weblogic.jar;D:\bea\WEBLOG~1\server\lib\ojdbc14.jar;D:\bea\WEBLOG~1\co
mmon\eval\pointbase\lib\pbserver44.jar;D:\bea\WEBLOG~1\common\eval\pointbase\lib\pbclient44.jar;D:\bea\JDK141~1\jre\lib\rt.jar;D:\bea\WEBLOG
~1\server\lib\webservices.jar;, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, javax.rmi.
CORBA.PortableRemoteObjectClass=weblogic.iiop.PortableRemoteObjectDelegateImpl, sun.cpu.endian=little, sun.os.patch.level=Service Pack 1, ja
va.io.tmpdir=C:\DOCUME~1\doug\LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicse
nv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=D:\bea\JDK141~1\jre\lib\ext, user.dir=D:\bea\user_projects\domains\ruleEngine, line.separ
ator=
, java.vm.name=Java HotSpot(TM) Client VM, javax.xml.soap.MessageFactory=weblogic.webservice.core.soap.MessageFactoryImpl, file.encoding=Cp1
252, org.omg.CORBA.ORBClass=weblogic.corba.orb.ORB, javax.xml.rpc.ServiceFactory=weblogic.webservice.core.rpc.ServiceFactoryImpl, weblogic.P
roductionModeEnabled=false, java.specification.version=1.4, hibernate.show_sql=true}
14:48:37,890  INFO Dialect:83 - Using dialect: net.sf.hibernate.dialect.OracleDialect
14:48:37,906  INFO NamingHelper:26 - JNDI InitialContext properties:{}
14:48:37,906  INFO DatasourceConnectionProvider:52 - Using datasource: ruleDS
14:48:37,906  INFO SessionFactoryImpl:162 - Use outer join fetching: true
14:48:38,234  INFO SessionFactoryImpl:185 - Use scrollable result sets: true
14:48:38,234  INFO SessionFactoryImpl:186 - JDBC 2 max batch size: 15
14:48:38,250  INFO SessionFactoryImpl:194 - echoing all SQL to stdout
14:48:39,140 DEBUG SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory
14:48:39,156 DEBUG SessionFactoryObjectFactory:76 - registered: 13f8b386f7df3b2600f7df3b2be40000 (unnamed)
14:48:39,156  INFO SessionFactoryObjectFactory:82 - no JDNI name configured
14:48:39,156  INFO SessionFactoryImpl:269 - Query language substitutions: {}
14:48:39,171 DEBUG SessionFactoryImpl:281 - instantiated session factory
14:48:39,187 DEBUG SessionFactoryImpl:595 - serializing: 13f8b386f7df3b2600f7df3b2be40000
14:48:39,187 DEBUG SessionFactoryImpl:597 - serialized
14:48:39,187 DEBUG SessionFactoryImpl:590 - deserializing
14:48:39,187 DEBUG SessionFactoryImpl:592 - deserialized: 13f8b386f7df3b2600f7df3b2be40000
14:48:39,187 DEBUG SessionFactoryImpl:497 - Resolving serialized SessionFactory
14:48:39,187 DEBUG SessionFactoryObjectFactory:145 - lookup: uid=13f8b386f7df3b2600f7df3b2be40000
14:48:39,203 DEBUG SessionFactoryImpl:512 - resolved SessionFactory by uid
14:48:39,203 DEBUG SessionFactoryImpl:487 - Returning a Reference to the SessionFactory
14:48:39,406  INFO HibernatePersistenceEngineBean:133 - Trying to saveObject class org.scra.emall.rule.RuleDefinition
14:48:39,468 DEBUG SessionImpl:413 - opened session
14:48:39,468 DEBUG Cascades:237 - unsaved-value strategy NULL
14:48:39,468 DEBUG SessionImpl:1201 - saveOrUpdate() unsaved instance with id: null
14:48:39,468 DEBUG BatcherImpl:166 - about to open: 0 open PreparedStatements, 0 open ResultSets
14:48:39,484 DEBUG SessionFactoryImpl:526 - prepared statement get: select ruleDef_id_seq.nextval from dual
Hibernate: select ruleDef_id_seq.nextval from dual
14:48:39,484 DEBUG SessionFactoryImpl:536 - preparing statement
14:48:39,781 DEBUG SequenceGenerator:70 - Sequence identifier generated: 15
14:48:39,781 DEBUG BatcherImpl:173 - done closing: 0 open PreparedStatements, 0 open ResultSets
14:48:39,781 DEBUG SessionFactoryImpl:554 - closing statement
14:48:39,781 DEBUG SessionImpl:656 - saving [org.scra.emall.rule.RuleDefinition#15]
14:48:39,781 DEBUG SessionImpl:2011 - flushing session
14:48:39,796 DEBUG SessionImpl:2113 - Flushing entities and processing referenced collections
14:48:39,796 DEBUG SessionImpl:2397 - Processing unreferenced collections
14:48:39,796 DEBUG SessionImpl:2408 - Scheduling collection removes/(re)creates/updates
14:48:39,796 DEBUG SessionImpl:2023 - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
14:48:39,796 DEBUG SessionImpl:2028 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
14:48:39,796 DEBUG SessionImpl:2058 - executing flush
14:48:39,796 DEBUG SessionImpl:2428 - post flush
14:48:39,796 DEBUG SessionImpl:435 - closing session
14:48:39,796 DEBUG SessionImpl:2930 - disconnecting session
14:48:39,812 DEBUG SessionImpl:447 - transaction completion
14:49:19,812  INFO HibernatePersistenceEngineBean:133 - Trying to saveObject class org.scra.emall.rule.RuleDefinition
14:49:19,812 DEBUG SessionImpl:413 - opened session
14:49:19,812 DEBUG Cascades:237 - unsaved-value strategy NULL
14:49:19,812 DEBUG SessionImpl:1201 - saveOrUpdate() unsaved instance with id: null
14:49:19,812 DEBUG BatcherImpl:166 - about to open: 0 open PreparedStatements, 0 open ResultSets
14:49:19,828 DEBUG SessionFactoryImpl:526 - prepared statement get: select ruleDef_id_seq.nextval from dual
Hibernate: select ruleDef_id_seq.nextval from dual
14:49:19,828 DEBUG SessionFactoryImpl:536 - preparing statement
14:49:19,843 DEBUG SequenceGenerator:70 - Sequence identifier generated: 16
14:49:19,843 DEBUG BatcherImpl:173 - done closing: 0 open PreparedStatements, 0 open ResultSets
14:49:19,843 DEBUG SessionFactoryImpl:554 - closing statement
14:49:19,843 DEBUG SessionImpl:656 - saving [org.scra.emall.rule.RuleDefinition#16]
14:49:19,843 DEBUG SessionImpl:2011 - flushing session
14:49:19,843 DEBUG SessionImpl:2113 - Flushing entities and processing referenced collections
14:49:19,843 DEBUG SessionImpl:2397 - Processing unreferenced collections
14:49:19,843 DEBUG SessionImpl:2408 - Scheduling collection removes/(re)creates/updates
14:49:19,843 DEBUG SessionImpl:2023 - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
14:49:19,843 DEBUG SessionImpl:2028 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
14:49:19,843 DEBUG SessionImpl:2058 - executing flush
14:49:19,843 DEBUG SessionImpl:2428 - post flush
14:49:19,843 DEBUG SessionImpl:435 - closing session
14:49:19,843 DEBUG SessionImpl:2930 - disconnecting session
14:49:19,843 DEBUG SessionImpl:447 - transaction completion
14:53:39,734 DEBUG SessionImpl:2981 - running Session.finalize()


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 7:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Looks like you accidently have
* implemented Lifecycle to return VETO
* created two different sessions
* called session.clear()


Top
 Profile  
 
 Post subject: think that fixes it
PostPosted: Sat Sep 27, 2003 12:52 pm 
Newbie

Joined: Thu Sep 25, 2003 11:04 am
Posts: 6
Location: Charleston, SC
Great catch Gavin!

in trying to reduce the dependencies on a given persistent framework, i implemented the Lifecycle methods in a base persistent object and was returning true as the default. Will change to return NO_VETO instead.

I'm fairly certain I don't call session.clear() or create two different sessions. will double check when i get back to work on monday.

Thanks to all those who helped. Hibernate rocks!

Doug


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.