-->
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.  [ 2 posts ] 
Author Message
 Post subject: could not read a hi value
PostPosted: Tue Sep 14, 2004 2:09 pm 
Newbie

Joined: Fri Mar 05, 2004 3:22 pm
Posts: 8
Hi, I'm having trouble in a EJB app, in the id generator. Please if someone know how to help, please reply.

Regards,
Luis

Hibernate version:
2.11
Mapping documents:
PropuestaComercio.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class
name="mx.com.prosa.bdu.dmn.mantenimiento.propuesta.PropuestaComercio"
table="TBL_BDU_PROPUESTAS_COM" lazy="true">

<id name="id">
<column name="oid" sql-type="int" not-null="true"/>
<generator class="net.sf.hibernate.id.TableHiLoGenerator">
<param name="table">TBL_BDU_IDENTIFICADORES</param>
<param name="column">ID_PROP_COMERCIO</param>
<param name="max_lo">1</param>
</generator>
</id>

<many-to-one name="status"
column="COM_ESTATU .......
...


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

public void crear(Object entidad) throws BDUException {
Transaction tx = null;
try {
session = PersistenceConnector.getInstance().getSession();
propCom = (PropuestaComercio) entidad;
propCom.getComercio().setPresentacion(false);
if (propCom.getComercio().getCategoriaPonderada() != null) {
if (propCom.getComercio().getCategoriaPonderada().equals(new Long(0))) {
propCom.getComercio().setCategoriaPonderada(null);
}
}
System.out.println("Categoria ponderada: " + propCom.getComercio().getCategoriaPonderada());
System.out.println(" ---- -**** ---- CECOBAN: " + propCom.getComercio().getCuenta().getCecoban());
// if (propCom.getComercio().getCadena() != null)
// System.out.println("La cadena es: ::: :::::: ::: : :: :: " + propCom.getComercio().getCadena().getOid());
tx = session.beginTransaction();
if (propCom.getComercio().getClaveRecontratacion() != null) {
System.out.println("Clave de Recontratacion: " + propCom.getComercio().getClaveRecontratacion().getId());
} else {
System.out.println("Clave de Recontratacion NULA " + propCom.getComercio().getClaveRecontratacion());
}
// guardamos el negocio nuevo...
Long a = (Long) session.save(propCom);
tx.commit();
tx = session.beginTransaction();
propCom.setId(a);
guardarDatosComercio(session, true);
tx.commit();
} catch (Exception e) {
e.printStackTrace();
if (tx != null)
try {
tx.rollback();
} catch (Exception h) {
throw new PersistenceException(h.getClass().getName(),
this.getClass().getName(),
"crear",
e.getMessage());
}
} finally {
try {
session.flush();
session.close();
} catch (HibernateException e) {
throw new PersistenceException(e.getClass().getName(), this.getClass().getName(), //this.getClass().getMethod().getName(),
"crear", e.getMessage());
}
}
}

Full stack trace of any exception that occurs:

WARNING: CORE3283: stderr: 590937 [service-j2ee-6] ERROR id.TableGenerator - could not read a hi value
WARNING: CORE3283: stderr: java.sql.SQLException: ORA-01002: fetch out of sequence
WARNING: CORE3283: stderr: at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
WARNING: CORE3283: stderr: at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
WARNING: CORE3283: stderr: at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
WARNING: CORE3283: stderr: at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
WARNING: CORE3283: stderr: at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:1198)
WARNING: CORE3283: stderr: at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2400)
WARNING: CORE3283: stderr: at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672)
WARNING: CORE3283: stderr: at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
WARNING: CORE3283: stderr: at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527)
WARNING: CORE3283: stderr: at net.sf.hibernate.id.TableGenerator.generate(TableGenerator.java:93)
WARNING: CORE3283: stderr: at net.sf.hibernate.id.TableHiLoGenerator.generate(TableHiLoGenerator.java:59)
WARNING: CORE3283: stderr: at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:758)
WARNING: CORE3283: stderr: at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:731)
WARNING: CORE3283: stderr: at mx.com.prosa.bdu.eai.mantenimiento.propuesta.comercio.PropuestaComercioDAO.crear(PropuestaComercioDAO.java:230)
WARNING: CORE3283: stderr: at mx.com.prosa.bdu.dmn.mantenimiento.propuesta.PropuestaComercio.crear(PropuestaComercio.java:244)
WARNING: CORE3283: stderr: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
WARNING: CORE3283: stderr: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
WARNING: CORE3283: stderr: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
WARNING: CORE3283: stderr: at java.lang.reflect.Method.invoke(Method.java:324)

Name and version of the database you are using:

Oracle 9i

The generated SQL (show_sql=true):

no sql generated


Top
 Profile  
 
 Post subject: Possibly Dialect related
PostPosted: Thu Sep 16, 2004 9:27 am 
Newbie

Joined: Thu Sep 16, 2004 9:09 am
Posts: 1
I am not sure if you are using a dialect

#hibernate.dialect net.sf.hibernate.dialect.Oracle9Dialect

but we noticed a this message when we mistyped our Dialect. You can include this in your properties file.

_________________
Thank you,
Mike


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.