-->
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.  [ 1 post ] 
Author Message
 Post subject: ObjectNotFoundException at composite-id with a Date column
PostPosted: Wed Dec 29, 2004 4:22 pm 
Newbie

Joined: Wed Dec 29, 2004 4:00 pm
Posts: 1
Location: BRAZIL
Hibernate version:
2.1.7
Mapping documents:
This is the entity:

file:
Saldo.hbm.xml

contents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="la.foton.banklink.libfdk.est.EstSld" table="SLD">
<composite-id class="la.foton.banklink.libfdk.est.EstSldA">
<key-property name="ctaId" column="ctaId" type="java.lang.String"/>
<key-property name="sldTip" column="sldTip" type="java.lang.Integer"
access="la.foton.infra.dao.hbr.ValueSetAccessor"/>
<key-property name="sldDat" column="sldDat" type="java.util.Date"/>
</composite-id>
<property name="ctaId" column="ctaId" type="java.lang.String" insert="false" update="false"/>
<property name="sldTip" column="sldTip" type="java.lang.Integer"
access="la.foton.infra.dao.hbr.ValueSetAccessor" insert="false" update="false"/>
<property name="sldDat" column="sldDat" type="java.util.Date" insert="false" update="false"/>
<property name="sldVal" column="sldVal" type="java.math.BigDecimal"/>
<property name="sldDatHorCrg" column="sldDatHorCrg" type="java.util.Date"/>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

The code I´m trying to run does only a save operation at an entity and tries to load it without "flushing" the session. If I flush the session, it works. Without flushing the session, an "ObjectNotFoundException" is thrown... This problem occurs only with entities that have an "Date" column inside the "composite-id" element.
Thanks in advance...

Full stack trace of any exception that occurs:


18:15:07,392 ERROR [STDERR] net.sf.hibernate.ObjectNotFoundException: No row with the given identifier exists: la.foton.banklink.libfdk.est.EstSldA@c8994e30, of class: la.foton.banklink.libfdk.est.EstSld
at net.sf.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:24)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1910)
at la.foton.infra.dao.hbr.AbstractHbrDao.load(AbstractHbrDao.java:176)
at la.foton.banklink.infra.dao.hbr.HbrDaoSaldo.load(HbrDaoSaldo.java:217)
at la.foton.banklink.infra.processador.ejb.session.ProcessadorLogBean.processa(ProcessadorLogBean.java:161)
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:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.GeneratedMethodAccessor139.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)


Name and version of the database you are using:

Oracle 9i

The generated SQL (show_sql=true):

DEBUG [net.sf.hibernate.SQL] select estsld0_.ctaId as ctaId0_, estsld0_.sldTip as sldTip0_, estsld0_.sldDat as sldDat0_, estsld0_.ctaId as ctaId0_, estsld0_.sldTip as sldTip0_, estsld0_.sldDat as sldDat0_, estsld0_.sldVal as sldVal0_, estsld0_.sldDatHorCrg as sldDatHo5_0_ from SLD estsld0_ where estsld0_.ctaId=? and estsld0_.sldTip=? and estsld0_.sldDat=?
2004-12-29 16:36:07,608 DEBUG [net.sf.hibernate.impl.BatcherImpl] preparing statement
2004-12-29 16:36:07,624 DEBUG [net.sf.hibernate.type.StringType] binding '1ea0024-10057e673c3-84221fd04f795e59' to parameter: 1
2004-12-29 16:36:07,624 DEBUG [net.sf.hibernate.type.IntegerType] binding '7' to parameter: 2
2004-12-29 16:36:07,639 DEBUG [net.sf.hibernate.type.TimestampType] binding '29 Dezembro 2004 00:00:00' to parameter: 3
2004-12-29 16:36:07,655 DEBUG [net.sf.hibernate.loader.Loader] processing result set
2004-12-29 16:36:07,655 DEBUG [net.sf.hibernate.loader.Loader] done processing result set (0 rows)
2004-12-29 16:36:07,655 DEBUG [net.sf.hibernate.impl.BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
2004-12-29 16:36:07,655 DEBUG [net.sf.hibernate.impl.BatcherImpl] closing statement

Debug level Hibernate log excerpt:

None


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

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.