You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Crecente Casanova, David" <dc...@indra.es> on 2003/07/17 14:34:48 UTC

RV: Problems with sequences.

    Hi all,
 
    I am getting the next error:


---------------- 
 Caused by: org.apache.ojb.broker.PersistenceBrokerException: Could not get key value: 
 Could not grab next id, failed with 
 Excepción de E/S: Socket closed
 Creation of new sequence failed with 
 Excepción de E/S: Socket closed
 : Excepción de E/S: Socket closed
 	at org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(BrokerHelper.java:316)
 	at org.apache.ojb.broker.util.BrokerHelper.getValuesForObject(BrokerHelper.java:349)
 	at org.apache.ojb.broker.util.BrokerHelper.getKeyValues(BrokerHelper.java:215)
 	at org.apache.ojb.broker.Identity.init(Identity.java:198)
 	... 21 more
 Caused by: org.apache.ojb.broker.util.sequence.SequenceManagerException: 
 Could not grab next id, failed with 
 Excepción de E/S: Socket closed
 Creation of new sequence failed with 
 Excepción de E/S: Socket closed
 : Excepción de E/S: Socket closed
 	at org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.getUniqueLong(SequenceManagerNextValImpl.java:172)
 	at org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.getUniqueId(SequenceManagerNextValImpl.java:144)
 	at org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUniqueValue(AbstractSequenceManager.java:167)
 	at org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(BrokerHelper.java:303)
 	... 24 more
 Caused by: java.sql.SQLException: Excepción de E/S: Socket closed
 	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
 	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
 	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
 	at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:562)
 	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2786)
 	at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:925)
 	at com.p6spy.engine.logging.P6LogStatement.execute(P6LogStatement.java:149)
 	at org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.createSequence(SequenceManagerNextValImpl.java:245)
 	at org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.getUniqueLong(SequenceManagerNextValImpl.java:168)
 	... 27 more
---------------
 
    I am working with Oracle 9i, Tomcat, and OJB.
    I am using oracle sequences and 'SequenceManagerNextValImpl', I belive it is the best option for me.
 
    Example of xml descriptor for a table is:
 

-----------------
 <!-- This repository file is generated by the impart OJB Generator -->
 <!--           www.impart.ch info@impart.ch                        -->
 <!--        created at 9 Jul 2003 11:37:50 GMT                     -->
 
 
 <!-- Definitions for .OPENCOWNER -->
 <class-descriptor 
   class="com.indra.crm.vo.Crm_cliente_general"
   table="OPENCOWNER.CRM_CLIENTE"
 >
   <field-descriptor id="66"
    name="ln_id_cliente"
     column="LN_ID_CLIENTE"
     jdbc-type="INTEGER"
     primarykey="true"
 	autoincrement="true"
 	sequence-name="sec_cliente"		---->>>> My oracle sequence
   />
   <field-descriptor id="67"
     name="ds_nb_cliente"
     column="DS_NB_CLIENTE"
     jdbc-type="VARCHAR"
   />
 
 . . . . . . 
 
 </class-descriptor>
 --------------


    My jdbc-connection-descriptor is like:

------------- 
 	<jdbc-connection-descriptor dbalias="thin:@192.168.168.100:1521:aunagc" default-connection="true" driver="com.p6spy.engine.spy.P6SpyDriver" jcd-alias="" jdbc-level="2.0" password="OPENCOWNER" platform="Oracle" rotocol="jdbc" subprotocol="oracle" username="OPENCOWNER">
 		<sequence-manager className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl"/>
 	</jdbc-connection-descriptor>
-------------
 
    When I run a simple JUnit Test I don't have problems but when I run all my test together this error appears.
 
    Thank you in advance.
 
 
 David Crecente Casanova
 mailto:dcrecente@telenium.es
 Software Engineer
 TELENIUM, The New Millennium Telecom Company>  
 Agustín de Foxá, 25, plta. 13 
 28036 MADRID 
 Tel. +34 91 315 85 62 
 Fax +34 91 315 63 37 
 http://www.telenium.es
 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Problems with sequences.

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi,

don't know what's wrong. Did you have tried
running your tests without using p6spy?

regards,
Armin

----- Original Message -----
From: "Crecente Casanova, David" <dc...@indra.es>
To: <oj...@db.apache.org>
Sent: Thursday, July 17, 2003 2:34 PM
Subject: RV: Problems with sequences.



    Hi all,

    I am getting the next error:


----------------
 Caused by: org.apache.ojb.broker.PersistenceBrokerException: Could not
get key value:
 Could not grab next id, failed with
 Excepción de E/S: Socket closed
 Creation of new sequence failed with
 Excepción de E/S: Socket closed
 : Excepción de E/S: Socket closed
  at
org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(BrokerHelp
er.java:316)
  at
org.apache.ojb.broker.util.BrokerHelper.getValuesForObject(BrokerHelper.
java:349)
  at
org.apache.ojb.broker.util.BrokerHelper.getKeyValues(BrokerHelper.java:2
15)
  at org.apache.ojb.broker.Identity.init(Identity.java:198)
  ... 21 more
 Caused by:
org.apache.ojb.broker.util.sequence.SequenceManagerException:
 Could not grab next id, failed with
 Excepción de E/S: Socket closed
 Creation of new sequence failed with
 Excepción de E/S: Socket closed
 : Excepción de E/S: Socket closed
  at
org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.getUnique
Long(SequenceManagerNextValImpl.java:172)
  at
org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.getUnique
Id(SequenceManagerNextValImpl.java:144)
  at
org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUniqueVal
ue(AbstractSequenceManager.java:167)
  at
org.apache.ojb.broker.util.BrokerHelper.getAutoIncrementValue(BrokerHelp
er.java:303)
  ... 24 more
 Caused by: java.sql.SQLException: Excepción de E/S: Socket closed
  at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
  at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
  at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
  at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:562)
  at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.
java:2786)
  at
oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:925)
  at
com.p6spy.engine.logging.P6LogStatement.execute(P6LogStatement.java:149)
  at
org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.createSeq
uence(SequenceManagerNextValImpl.java:245)
  at
org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.getUnique
Long(SequenceManagerNextValImpl.java:168)
  ... 27 more
---------------

    I am working with Oracle 9i, Tomcat, and OJB.
    I am using oracle sequences and 'SequenceManagerNextValImpl', I
belive it is the best option for me.

    Example of xml descriptor for a table is:


-----------------
 <!-- This repository file is generated by the impart OJB Generator -->
 <!--           www.impart.ch info@impart.ch                        -->
 <!--        created at 9 Jul 2003 11:37:50 GMT                     -->


 <!-- Definitions for .OPENCOWNER -->
 <class-descriptor
   class="com.indra.crm.vo.Crm_cliente_general"
   table="OPENCOWNER.CRM_CLIENTE"
 >
   <field-descriptor id="66"
    name="ln_id_cliente"
     column="LN_ID_CLIENTE"
     jdbc-type="INTEGER"
     primarykey="true"
  autoincrement="true"
  sequence-name="sec_cliente" ---->>>> My oracle sequence
   />
   <field-descriptor id="67"
     name="ds_nb_cliente"
     column="DS_NB_CLIENTE"
     jdbc-type="VARCHAR"
   />

 . . . . . .

 </class-descriptor>
 --------------


    My jdbc-connection-descriptor is like:

-------------
  <jdbc-connection-descriptor
dbalias="thin:@192.168.168.100:1521:aunagc" default-connection="true"
driver="com.p6spy.engine.spy.P6SpyDriver" jcd-alias="" jdbc-level="2.0"
password="OPENCOWNER" platform="Oracle" rotocol="jdbc"
subprotocol="oracle" username="OPENCOWNER">
  <sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImp
l"/>
  </jdbc-connection-descriptor>
-------------

    When I run a simple JUnit Test I don't have problems but when I run
all my test together this error appears.

    Thank you in advance.


 David Crecente Casanova
 mailto:dcrecente@telenium.es
 Software Engineer
 TELENIUM, The New Millennium Telecom Company>
 Agustín de Foxá, 25, plta. 13
 28036 MADRID
 Tel. +34 91 315 85 62
 Fax +34 91 315 63 37
 http://www.telenium.es


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org