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 Brian Chaplin <bc...@chaplinsolutions.com> on 2003/07/03 20:17:33 UTC
How do I customize insert for Sybase identity columns?
I'm trying to handle sybase and SQL Server identity columns by allowing OJB
to control the sequence number generation through the
SequenceManagerHighLowImpl.
However, to do this I need to issue a "set identity_insert tablename on"
before the actual insert statement is executed?
I did this in the afterInsert method of my BrokerAware persistence object as
follows:
Connection conn = getConnection();
stmt = conn.createStatement();
stmt.execute("set identity_insert mcsp_test on");
stmt.close();
Although the set statment was executed successfully, when the persistence
broker issued the insert command, it still failed.
afterInsert
1057255340516|0|1|statement||set identity_insert mcsp_test on
1057255340516|0|0|batch|INSERT INTO mcsp_test (id,col1) VALUES (?,?) |INSERT
INTO mcsp_test (id,col1) VALUES ('97','a13')
1057255340531|15|0|statement|INSERT INTO mcsp_test (id,col1) VALUES (?,?)
|INSERT INTO mcsp_test (id,col1) VALUES ('97','a13')
[org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR: Commit on
underlying connection failed, try to rollback
JZ0BE: BatchUpdateException: Error occurred while executing batch statement:
Explicit value specified for identity field in table 'mcsp_test' when
IDENTITY_INSERT is set to OFF.
I'm not sure why. Perhaps it was issued on another connection in my pool
but this still fails even for a singleton connection.
Is there a way I can override how the persistence broker is implementing the
insert statement?
Or is there a way I can customize the insert statement to issue a "set
command"?
RE: Borrow broker from pool failed
Posted by João Luz <Jo...@ist.utl.pt>.
Try to add validationQuery="select 1" to connection-pool.
-----Original Message-----
From: Christophe Marcourt [mailto:cmarcourt@wanadoo.fr]
Sent: quinta-feira, 3 de Julho de 2003 22:29
To: OJB Users List
Subject: Re: Borrow broker from pool failed
I give you as well my connection configuration :
<jdbc-connection-descriptor
dbalias="//localhost:3306/housebooking?autoReconnect=true"
default-connection="true"
driver="org.gjt.mm.mysql.Driver" jcd-alias="myConnection" jdbc-level="2.0"
password="<password>" platform="MySQL"
protocol="jdbc" subprotocol="mysql" useAutoCommit="1"
username="christophe">
<connection-pool logAbandoned="false" maxActive="100" maxIdle="30"
maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="60"/>
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerInMemoryImpl"/
>
</jdbc-connection-descriptor>
cheers.
Christophe
----- Original Message -----
From: "Christophe Marcourt" <cm...@wanadoo.fr>
To: "OJB Users List" <oj...@db.apache.org>; "Armin Waibel"
<ar...@code-au-lait.de>
Sent: Thursday, July 03, 2003 11:20 PM
Subject: Re: Borrow broker from pool failed
> Here you go :
>
> org.apache.ojb.broker.PBFactoryException: Borrow broker from pool failed
> 2003-07-03 22:39:51,125 FATAL [Thread-5] -
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersist
> enceBroker(Unknown Source)
> 2003-07-03 22:39:51,125 FATAL [Thread-5] -
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.defaultPersis
> tenceBroker(Unknown Source)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unkn
> own Source)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> com.hbk.admin.form.RoomParameter.doDefault(RoomParameter.java:152)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
com.celeno.mandarino.form.AbstractFormDispatch.process(AbstractFormDispatch.
> java:175)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> com.celeno.mandarino.Controller.handleRequest(Controller.java:117)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 72)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:333)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:256)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:191)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:494)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
> )
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> java:171)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
> )
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :174)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
> ction(Http11Protocol.java:392)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
> a:619)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> java.lang.Thread.run(Thread.java:536)
>
> By the way I do close() my broker every time I use it.
>
> Christophe
>
> ----- Original Message -----
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, July 03, 2003 11:18 PM
> Subject: Re: Borrow broker from pool failed
>
>
> > Can you post the whole stack trace, please?
> >
> > regards,
> > Armin
> >
> > ----- Original Message -----
> > From: "Christophe Marcourt" <cm...@wanadoo.fr>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Thursday, July 03, 2003 10:52 PM
> > Subject: Borrow broker from pool failed
> >
> >
> > > Hi,
> > >
> > > after a couple of hours of inactivity I get a "Borrow broker from pool
> > > failed" when I request a page on my site where's OJB make a simple
> > SELECT
> > > query.
> > > I'm using MySQL 4 and OJB 1.0 rc3.
> > >
> > > Any idea ?
> > >
> > > Christophe
> > >
> > >
> > > ---
> > > Ce message Envoi est certifié sans virus connu.
> > > Protégé par l'antivirus AVG Deluxe.
> > > Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
>
>
> ---
> Ce message Envoi est certifié sans virus connu.
> Protégé par l'antivirus AVG Deluxe.
> Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Borrow broker from pool failed
Posted by Christophe Marcourt <cm...@wanadoo.fr>.
I give you as well my connection configuration :
<jdbc-connection-descriptor
dbalias="//localhost:3306/housebooking?autoReconnect=true"
default-connection="true"
driver="org.gjt.mm.mysql.Driver" jcd-alias="myConnection" jdbc-level="2.0"
password="<password>" platform="MySQL"
protocol="jdbc" subprotocol="mysql" useAutoCommit="1"
username="christophe">
<connection-pool logAbandoned="false" maxActive="100" maxIdle="30"
maxWait="10000" removeAbandoned="true" removeAbandonedTimeout="60"/>
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerInMemoryImpl"/
>
</jdbc-connection-descriptor>
cheers.
Christophe
----- Original Message -----
From: "Christophe Marcourt" <cm...@wanadoo.fr>
To: "OJB Users List" <oj...@db.apache.org>; "Armin Waibel"
<ar...@code-au-lait.de>
Sent: Thursday, July 03, 2003 11:20 PM
Subject: Re: Borrow broker from pool failed
> Here you go :
>
> org.apache.ojb.broker.PBFactoryException: Borrow broker from pool failed
> 2003-07-03 22:39:51,125 FATAL [Thread-5] -
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersist
> enceBroker(Unknown Source)
> 2003-07-03 22:39:51,125 FATAL [Thread-5] -
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.defaultPersis
> tenceBroker(Unknown Source)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unkn
> own Source)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> com.hbk.admin.form.RoomParameter.doDefault(RoomParameter.java:152)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
com.celeno.mandarino.form.AbstractFormDispatch.process(AbstractFormDispatch.
> java:175)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> com.celeno.mandarino.Controller.handleRequest(Controller.java:117)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 72)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:333)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:256)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:191)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:494)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
> )
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> java:171)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
> )
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :174)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
> ction(Http11Protocol.java:392)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
> a:619)
> 2003-07-03 22:39:51,129 FATAL [Thread-5] -
> java.lang.Thread.run(Thread.java:536)
>
> By the way I do close() my broker every time I use it.
>
> Christophe
>
> ----- Original Message -----
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, July 03, 2003 11:18 PM
> Subject: Re: Borrow broker from pool failed
>
>
> > Can you post the whole stack trace, please?
> >
> > regards,
> > Armin
> >
> > ----- Original Message -----
> > From: "Christophe Marcourt" <cm...@wanadoo.fr>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Thursday, July 03, 2003 10:52 PM
> > Subject: Borrow broker from pool failed
> >
> >
> > > Hi,
> > >
> > > after a couple of hours of inactivity I get a "Borrow broker from pool
> > > failed" when I request a page on my site where's OJB make a simple
> > SELECT
> > > query.
> > > I'm using MySQL 4 and OJB 1.0 rc3.
> > >
> > > Any idea ?
> > >
> > > Christophe
> > >
> > >
> > > ---
> > > Ce message Envoi est certifié sans virus connu.
> > > Protégé par l'antivirus AVG Deluxe.
> > > Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
>
>
> ---
> Ce message Envoi est certifié sans virus connu.
> Protégé par l'antivirus AVG Deluxe.
> Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
Re: Borrow broker from pool failed
Posted by Christophe Marcourt <cm...@wanadoo.fr>.
Here you go :
org.apache.ojb.broker.PBFactoryException: Borrow broker from pool failed
2003-07-03 22:39:51,125 FATAL [Thread-5] -
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersist
enceBroker(Unknown Source)
2003-07-03 22:39:51,125 FATAL [Thread-5] -
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.defaultPersis
tenceBroker(Unknown Source)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unkn
own Source)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
com.hbk.admin.form.RoomParameter.doDefault(RoomParameter.java:152)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
com.celeno.mandarino.form.AbstractFormDispatch.process(AbstractFormDispatch.
java:175)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
com.celeno.mandarino.Controller.handleRequest(Controller.java:117)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
72)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:333)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
2003-07-03 22:39:51,126 FATAL [Thread-5] -
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:494)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
2003-07-03 22:39:51,127 FATAL [Thread-5] -
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
2003-07-03 22:39:51,128 FATAL [Thread-5] -
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
java.lang.Thread.run(Thread.java:536)
By the way I do close() my broker every time I use it.
Christophe
----- Original Message -----
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, July 03, 2003 11:18 PM
Subject: Re: Borrow broker from pool failed
> Can you post the whole stack trace, please?
>
> regards,
> Armin
>
> ----- Original Message -----
> From: "Christophe Marcourt" <cm...@wanadoo.fr>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, July 03, 2003 10:52 PM
> Subject: Borrow broker from pool failed
>
>
> > Hi,
> >
> > after a couple of hours of inactivity I get a "Borrow broker from pool
> > failed" when I request a page on my site where's OJB make a simple
> SELECT
> > query.
> > I'm using MySQL 4 and OJB 1.0 rc3.
> >
> > Any idea ?
> >
> > Christophe
> >
> >
> > ---
> > Ce message Envoi est certifié sans virus connu.
> > Protégé par l'antivirus AVG Deluxe.
> > Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
Re: Borrow broker from pool failed
Posted by Armin Waibel <ar...@code-au-lait.de>.
Can you post the whole stack trace, please?
regards,
Armin
----- Original Message -----
From: "Christophe Marcourt" <cm...@wanadoo.fr>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, July 03, 2003 10:52 PM
Subject: Borrow broker from pool failed
> Hi,
>
> after a couple of hours of inactivity I get a "Borrow broker from pool
> failed" when I request a page on my site where's OJB make a simple
SELECT
> query.
> I'm using MySQL 4 and OJB 1.0 rc3.
>
> Any idea ?
>
> Christophe
>
>
> ---
> Ce message Envoi est certifié sans virus connu.
> Protégé par l'antivirus AVG Deluxe.
> Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
Borrow broker from pool failed
Posted by Christophe Marcourt <cm...@wanadoo.fr>.
Hi,
after a couple of hours of inactivity I get a "Borrow broker from pool
failed" when I request a page on my site where's OJB make a simple SELECT
query.
I'm using MySQL 4 and OJB 1.0 rc3.
Any idea ?
Christophe
---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
Re: How do I customize insert for Sybase identity columns?
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Brain,
every documentation contribution
is welcome ;-)
I think everybody from OJB give it
one's best, but it's really much to do.
regards,
Armin
----- Original Message -----
From: "Brian Chaplin" <bc...@chaplinsolutions.com>
To: <oj...@db.apache.org>
Sent: Tuesday, July 08, 2003 2:48 PM
Subject: Re: How do I customize insert for Sybase identity columns?
> Armin,
> It worked like a champ.
> Definitely a need for some java doc before release 1.0 :)
> Thanks for the quick response!
> Brian
> "Armin Waibel" <ar...@code-au-lait.de> wrote in message
> news:003c01c34489$10ad3160$6479fea9@win...
> > Hi Brain,
> >
> > ----- Original Message -----
> > From: "Brian Chaplin" <bc...@chaplinsolutions.com>
> > To: <oj...@db.apache.org>
> > Sent: Monday, July 07, 2003 2:44 PM
> > Subject: Re: How do I customize insert for Sybase identity columns?
> >
> >
> > > Armin,
> > > Using SequenceManagerInMemoryImpl didn't work. It looks like the
> > commands
> > > issued in the afterInsert callback are on another connection
> > regardless of
> > > the memory manager being used.
> >
> > with the latest version of OJB (more exact version > rc2) the
> > PersistenceAware callback methods retrieve a
> > PersistenceBroker instance
> > e.g.
> > public void afterInsert(PersistenceBroker broker)
> > throws PersistenceBrokerException;
> >
> > with broker.serviceConnectionManager().getConnection()
> > you will retrieve the current used connection (don't close
> > the connection after use!! - will be done by OJB, only close
> > your statement). Then fire your statement.
> >
> > To isolate your problem, don't use batch-mode
> > 'true' in jdbc-connection-descriptor.
> > If you don't use CVS please update
> > ConnectionManagerImpl#setBatchMode(boolean mode)
> > with
> >
> > return batchMode && platform.supportsBatchOperations();
> >
> > or get latest from CVS. This ensure that if batch-mode 'false'
> > was set, batch mode definitely was not used.
> >
> > Now try again and post your stack trace ;-)
> >
> > regards,
> > Armin
> >
> > >
> > > Should I modify the source code somewhere in this stack trace?
> > >
> > > at
> > >
> >
org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(BatchConne
> > ctio
> > > n.java:298)
> > >
> > > at
> > >
> >
org.apache.ojb.broker.util.batch.BatchConnection.commit(BatchConnection.
> > java
> > > :335)
> > >
> > > at
> > >
> >
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localCommit(Conn
> > ecti
> > > onManagerImpl.java:200)
> > >
> > > at
> > >
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.commitTransaction(Persi
> > sten
> > > ceBrokerImpl.java:385)
> > >
> > > at
> > >
> >
org.apache.ojb.broker.core.DelegatingPersistenceBroker.commitTransaction
> > (Del
> > > egatingPersistenceBroker.java:120)
> > >
> > >
> > > "Armin Waibel" <ar...@code-au-lait.de> wrote in message
> > > news:00b601c341a8$8ebb5a20$6479fea9@win...
> > > > Hi Brain,
> > > >
> > > > use another SM implementation (e.g. SequenceManagerInMemoryImpl)
> > > > or implement your own SequenceManager.
> > > >
> > > > HiLo-SM implementation use intern a new connection (because
> > > > we want to avoid 'rollback trouble'), thus your setting is made
> > > > on the wrong connection.
> > > >
> > > > regards,
> > > > Armin
> > > >
> > > > ----- Original Message -----
> > > > From: "Brian Chaplin" <bc...@chaplinsolutions.com>
> > > > To: <oj...@db.apache.org>
> > > > Sent: Thursday, July 03, 2003 8:17 PM
> > > > Subject: How do I customize insert for Sybase identity columns?
> > > >
> > > >
> > > > > I'm trying to handle sybase and SQL Server identity columns by
> > > > allowing OJB
> > > > > to control the sequence number generation through the
> > > > > SequenceManagerHighLowImpl.
> > > > >
> > > > > However, to do this I need to issue a "set identity_insert
> > tablename
> > > > on"
> > > > > before the actual insert statement is executed?
> > > > >
> > > > > I did this in the afterInsert method of my BrokerAware
persistence
> > > > object as
> > > > > follows:
> > > > >
> > > > > Connection conn = getConnection();
> > > > >
> > > > > stmt = conn.createStatement();
> > > > >
> > > > > stmt.execute("set identity_insert mcsp_test on");
> > > > >
> > > > > stmt.close();
> > > > >
> > > > >
> > > > >
> > > > > Although the set statment was executed successfully, when the
> > > > persistence
> > > > > broker issued the insert command, it still failed.
> > > > >
> > > > > afterInsert
> > > > >
> > > > > 1057255340516|0|1|statement||set identity_insert mcsp_test on
> > > > >
> > > > > 1057255340516|0|0|batch|INSERT INTO mcsp_test (id,col1) VALUES
> > (?,?)
> > > > |INSERT
> > > > > INTO mcsp_test (id,col1) VALUES ('97','a13')
> > > > >
> > > > > 1057255340531|15|0|statement|INSERT INTO mcsp_test (id,col1)
> > VALUES
> > > > (?,?)
> > > > > |INSERT INTO mcsp_test (id,col1) VALUES ('97','a13')
> > > > >
> > > > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl]
ERROR:
> > > > Commit on
> > > > > underlying connection failed, try to rollback
> > > > >
> > > > > JZ0BE: BatchUpdateException: Error occurred while executing
batch
> > > > statement:
> > > > > Explicit value specified for identity field in table
'mcsp_test'
> > when
> > > > > IDENTITY_INSERT is set to OFF.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > I'm not sure why. Perhaps it was issued on another connection
in
> > my
> > > > pool
> > > > > but this still fails even for a singleton connection.
> > > > >
> > > > > Is there a way I can override how the persistence broker is
> > > > implementing the
> > > > > insert statement?
> > > > >
> > > > > Or is there a way I can customize the insert statement to
issue a
> > "set
> > > > > command"?
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> >
> ---------------------------------------------------------------------
> > > > > 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
> > >
> > >
> > >
>
>
>
>
> ---------------------------------------------------------------------
> 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
Re: How do I customize insert for Sybase identity columns?
Posted by Brian Chaplin <bc...@chaplinsolutions.com>.
Armin,
It worked like a champ.
Definitely a need for some java doc before release 1.0 :)
Thanks for the quick response!
Brian
"Armin Waibel" <ar...@code-au-lait.de> wrote in message
news:003c01c34489$10ad3160$6479fea9@win...
> Hi Brain,
>
> ----- Original Message -----
> From: "Brian Chaplin" <bc...@chaplinsolutions.com>
> To: <oj...@db.apache.org>
> Sent: Monday, July 07, 2003 2:44 PM
> Subject: Re: How do I customize insert for Sybase identity columns?
>
>
> > Armin,
> > Using SequenceManagerInMemoryImpl didn't work. It looks like the
> commands
> > issued in the afterInsert callback are on another connection
> regardless of
> > the memory manager being used.
>
> with the latest version of OJB (more exact version > rc2) the
> PersistenceAware callback methods retrieve a
> PersistenceBroker instance
> e.g.
> public void afterInsert(PersistenceBroker broker)
> throws PersistenceBrokerException;
>
> with broker.serviceConnectionManager().getConnection()
> you will retrieve the current used connection (don't close
> the connection after use!! - will be done by OJB, only close
> your statement). Then fire your statement.
>
> To isolate your problem, don't use batch-mode
> 'true' in jdbc-connection-descriptor.
> If you don't use CVS please update
> ConnectionManagerImpl#setBatchMode(boolean mode)
> with
>
> return batchMode && platform.supportsBatchOperations();
>
> or get latest from CVS. This ensure that if batch-mode 'false'
> was set, batch mode definitely was not used.
>
> Now try again and post your stack trace ;-)
>
> regards,
> Armin
>
> >
> > Should I modify the source code somewhere in this stack trace?
> >
> > at
> >
> org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(BatchConne
> ctio
> > n.java:298)
> >
> > at
> >
> org.apache.ojb.broker.util.batch.BatchConnection.commit(BatchConnection.
> java
> > :335)
> >
> > at
> >
> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localCommit(Conn
> ecti
> > onManagerImpl.java:200)
> >
> > at
> >
> org.apache.ojb.broker.core.PersistenceBrokerImpl.commitTransaction(Persi
> sten
> > ceBrokerImpl.java:385)
> >
> > at
> >
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.commitTransaction
> (Del
> > egatingPersistenceBroker.java:120)
> >
> >
> > "Armin Waibel" <ar...@code-au-lait.de> wrote in message
> > news:00b601c341a8$8ebb5a20$6479fea9@win...
> > > Hi Brain,
> > >
> > > use another SM implementation (e.g. SequenceManagerInMemoryImpl)
> > > or implement your own SequenceManager.
> > >
> > > HiLo-SM implementation use intern a new connection (because
> > > we want to avoid 'rollback trouble'), thus your setting is made
> > > on the wrong connection.
> > >
> > > regards,
> > > Armin
> > >
> > > ----- Original Message -----
> > > From: "Brian Chaplin" <bc...@chaplinsolutions.com>
> > > To: <oj...@db.apache.org>
> > > Sent: Thursday, July 03, 2003 8:17 PM
> > > Subject: How do I customize insert for Sybase identity columns?
> > >
> > >
> > > > I'm trying to handle sybase and SQL Server identity columns by
> > > allowing OJB
> > > > to control the sequence number generation through the
> > > > SequenceManagerHighLowImpl.
> > > >
> > > > However, to do this I need to issue a "set identity_insert
> tablename
> > > on"
> > > > before the actual insert statement is executed?
> > > >
> > > > I did this in the afterInsert method of my BrokerAware persistence
> > > object as
> > > > follows:
> > > >
> > > > Connection conn = getConnection();
> > > >
> > > > stmt = conn.createStatement();
> > > >
> > > > stmt.execute("set identity_insert mcsp_test on");
> > > >
> > > > stmt.close();
> > > >
> > > >
> > > >
> > > > Although the set statment was executed successfully, when the
> > > persistence
> > > > broker issued the insert command, it still failed.
> > > >
> > > > afterInsert
> > > >
> > > > 1057255340516|0|1|statement||set identity_insert mcsp_test on
> > > >
> > > > 1057255340516|0|0|batch|INSERT INTO mcsp_test (id,col1) VALUES
> (?,?)
> > > |INSERT
> > > > INTO mcsp_test (id,col1) VALUES ('97','a13')
> > > >
> > > > 1057255340531|15|0|statement|INSERT INTO mcsp_test (id,col1)
> VALUES
> > > (?,?)
> > > > |INSERT INTO mcsp_test (id,col1) VALUES ('97','a13')
> > > >
> > > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
> > > Commit on
> > > > underlying connection failed, try to rollback
> > > >
> > > > JZ0BE: BatchUpdateException: Error occurred while executing batch
> > > statement:
> > > > Explicit value specified for identity field in table 'mcsp_test'
> when
> > > > IDENTITY_INSERT is set to OFF.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > I'm not sure why. Perhaps it was issued on another connection in
> my
> > > pool
> > > > but this still fails even for a singleton connection.
> > > >
> > > > Is there a way I can override how the persistence broker is
> > > implementing the
> > > > insert statement?
> > > >
> > > > Or is there a way I can customize the insert statement to issue a
> "set
> > > > command"?
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > ---------------------------------------------------------------------
> > > > 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
> >
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: How do I customize insert for Sybase identity columns?
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Brain,
----- Original Message -----
From: "Brian Chaplin" <bc...@chaplinsolutions.com>
To: <oj...@db.apache.org>
Sent: Monday, July 07, 2003 2:44 PM
Subject: Re: How do I customize insert for Sybase identity columns?
> Armin,
> Using SequenceManagerInMemoryImpl didn't work. It looks like the
commands
> issued in the afterInsert callback are on another connection
regardless of
> the memory manager being used.
with the latest version of OJB (more exact version > rc2) the
PersistenceAware callback methods retrieve a
PersistenceBroker instance
e.g.
public void afterInsert(PersistenceBroker broker)
throws PersistenceBrokerException;
with broker.serviceConnectionManager().getConnection()
you will retrieve the current used connection (don't close
the connection after use!! - will be done by OJB, only close
your statement). Then fire your statement.
To isolate your problem, don't use batch-mode
'true' in jdbc-connection-descriptor.
If you don't use CVS please update
ConnectionManagerImpl#setBatchMode(boolean mode)
with
return batchMode && platform.supportsBatchOperations();
or get latest from CVS. This ensure that if batch-mode 'false'
was set, batch mode definitely was not used.
Now try again and post your stack trace ;-)
regards,
Armin
>
> Should I modify the source code somewhere in this stack trace?
>
> at
>
org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(BatchConne
ctio
> n.java:298)
>
> at
>
org.apache.ojb.broker.util.batch.BatchConnection.commit(BatchConnection.
java
> :335)
>
> at
>
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localCommit(Conn
ecti
> onManagerImpl.java:200)
>
> at
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.commitTransaction(Persi
sten
> ceBrokerImpl.java:385)
>
> at
>
org.apache.ojb.broker.core.DelegatingPersistenceBroker.commitTransaction
(Del
> egatingPersistenceBroker.java:120)
>
>
> "Armin Waibel" <ar...@code-au-lait.de> wrote in message
> news:00b601c341a8$8ebb5a20$6479fea9@win...
> > Hi Brain,
> >
> > use another SM implementation (e.g. SequenceManagerInMemoryImpl)
> > or implement your own SequenceManager.
> >
> > HiLo-SM implementation use intern a new connection (because
> > we want to avoid 'rollback trouble'), thus your setting is made
> > on the wrong connection.
> >
> > regards,
> > Armin
> >
> > ----- Original Message -----
> > From: "Brian Chaplin" <bc...@chaplinsolutions.com>
> > To: <oj...@db.apache.org>
> > Sent: Thursday, July 03, 2003 8:17 PM
> > Subject: How do I customize insert for Sybase identity columns?
> >
> >
> > > I'm trying to handle sybase and SQL Server identity columns by
> > allowing OJB
> > > to control the sequence number generation through the
> > > SequenceManagerHighLowImpl.
> > >
> > > However, to do this I need to issue a "set identity_insert
tablename
> > on"
> > > before the actual insert statement is executed?
> > >
> > > I did this in the afterInsert method of my BrokerAware persistence
> > object as
> > > follows:
> > >
> > > Connection conn = getConnection();
> > >
> > > stmt = conn.createStatement();
> > >
> > > stmt.execute("set identity_insert mcsp_test on");
> > >
> > > stmt.close();
> > >
> > >
> > >
> > > Although the set statment was executed successfully, when the
> > persistence
> > > broker issued the insert command, it still failed.
> > >
> > > afterInsert
> > >
> > > 1057255340516|0|1|statement||set identity_insert mcsp_test on
> > >
> > > 1057255340516|0|0|batch|INSERT INTO mcsp_test (id,col1) VALUES
(?,?)
> > |INSERT
> > > INTO mcsp_test (id,col1) VALUES ('97','a13')
> > >
> > > 1057255340531|15|0|statement|INSERT INTO mcsp_test (id,col1)
VALUES
> > (?,?)
> > > |INSERT INTO mcsp_test (id,col1) VALUES ('97','a13')
> > >
> > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
> > Commit on
> > > underlying connection failed, try to rollback
> > >
> > > JZ0BE: BatchUpdateException: Error occurred while executing batch
> > statement:
> > > Explicit value specified for identity field in table 'mcsp_test'
when
> > > IDENTITY_INSERT is set to OFF.
> > >
> > >
> > >
> > >
> > >
> > > I'm not sure why. Perhaps it was issued on another connection in
my
> > pool
> > > but this still fails even for a singleton connection.
> > >
> > > Is there a way I can override how the persistence broker is
> > implementing the
> > > insert statement?
> > >
> > > Or is there a way I can customize the insert statement to issue a
"set
> > > command"?
> > >
> > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: How do I customize insert for Sybase identity columns?
Posted by Er...@fobos-plus.ru.
Try to change repository descriptor by setting batch-mode property to
false. Batch mode is not supported by some version of Sybase(ASA 7 for
example)
"Brian Chaplin" <bc...@chaplinsolutions.com>
Sent by: news <ne...@main.gmane.org>
07.07.2003 16:44
Please respond to "OJB Users List"
To: ojb-user@db.apache.org
cc:
Subject: Re: How do I customize insert for Sybase identity
columns?
Armin,
Using SequenceManagerInMemoryImpl didn't work. It looks like the commands
issued in the afterInsert callback are on another connection regardless of
the memory manager being used.
Should I modify the source code somewhere in this stack trace?
at
org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(BatchConnectio
n.java:298)
at
org.apache.ojb.broker.util.batch.BatchConnection.commit(BatchConnection.java
:335)
at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localCommit(Connecti
onManagerImpl.java:200)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.commitTransaction(Persisten
ceBrokerImpl.java:385)
at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.commitTransaction(Del
egatingPersistenceBroker.java:120)
"Armin Waibel" <ar...@code-au-lait.de> wrote in message
news:00b601c341a8$8ebb5a20$6479fea9@win...
> Hi Brain,
>
> use another SM implementation (e.g. SequenceManagerInMemoryImpl)
> or implement your own SequenceManager.
>
> HiLo-SM implementation use intern a new connection (because
> we want to avoid 'rollback trouble'), thus your setting is made
> on the wrong connection.
>
> regards,
> Armin
>
> ----- Original Message -----
> From: "Brian Chaplin" <bc...@chaplinsolutions.com>
> To: <oj...@db.apache.org>
> Sent: Thursday, July 03, 2003 8:17 PM
> Subject: How do I customize insert for Sybase identity columns?
>
>
> > I'm trying to handle sybase and SQL Server identity columns by
> allowing OJB
> > to control the sequence number generation through the
> > SequenceManagerHighLowImpl.
> >
> > However, to do this I need to issue a "set identity_insert tablename
> on"
> > before the actual insert statement is executed?
> >
> > I did this in the afterInsert method of my BrokerAware persistence
> object as
> > follows:
> >
> > Connection conn = getConnection();
> >
> > stmt = conn.createStatement();
> >
> > stmt.execute("set identity_insert mcsp_test on");
> >
> > stmt.close();
> >
> >
> >
> > Although the set statment was executed successfully, when the
> persistence
> > broker issued the insert command, it still failed.
> >
> > afterInsert
> >
> > 1057255340516|0|1|statement||set identity_insert mcsp_test on
> >
> > 1057255340516|0|0|batch|INSERT INTO mcsp_test (id,col1) VALUES (?,?)
> |INSERT
> > INTO mcsp_test (id,col1) VALUES ('97','a13')
> >
> > 1057255340531|15|0|statement|INSERT INTO mcsp_test (id,col1) VALUES
> (?,?)
> > |INSERT INTO mcsp_test (id,col1) VALUES ('97','a13')
> >
> > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
> Commit on
> > underlying connection failed, try to rollback
> >
> > JZ0BE: BatchUpdateException: Error occurred while executing batch
> statement:
> > Explicit value specified for identity field in table 'mcsp_test' when
> > IDENTITY_INSERT is set to OFF.
> >
> >
> >
> >
> >
> > I'm not sure why. Perhaps it was issued on another connection in my
> pool
> > but this still fails even for a singleton connection.
> >
> > Is there a way I can override how the persistence broker is
> implementing the
> > insert statement?
> >
> > Or is there a way I can customize the insert statement to issue a "set
> > command"?
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
Re: How do I customize insert for Sybase identity columns?
Posted by Brian Chaplin <bc...@chaplinsolutions.com>.
Armin,
Using SequenceManagerInMemoryImpl didn't work. It looks like the commands
issued in the afterInsert callback are on another connection regardless of
the memory manager being used.
Should I modify the source code somewhere in this stack trace?
at
org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(BatchConnectio
n.java:298)
at
org.apache.ojb.broker.util.batch.BatchConnection.commit(BatchConnection.java
:335)
at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localCommit(Connecti
onManagerImpl.java:200)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.commitTransaction(Persisten
ceBrokerImpl.java:385)
at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.commitTransaction(Del
egatingPersistenceBroker.java:120)
"Armin Waibel" <ar...@code-au-lait.de> wrote in message
news:00b601c341a8$8ebb5a20$6479fea9@win...
> Hi Brain,
>
> use another SM implementation (e.g. SequenceManagerInMemoryImpl)
> or implement your own SequenceManager.
>
> HiLo-SM implementation use intern a new connection (because
> we want to avoid 'rollback trouble'), thus your setting is made
> on the wrong connection.
>
> regards,
> Armin
>
> ----- Original Message -----
> From: "Brian Chaplin" <bc...@chaplinsolutions.com>
> To: <oj...@db.apache.org>
> Sent: Thursday, July 03, 2003 8:17 PM
> Subject: How do I customize insert for Sybase identity columns?
>
>
> > I'm trying to handle sybase and SQL Server identity columns by
> allowing OJB
> > to control the sequence number generation through the
> > SequenceManagerHighLowImpl.
> >
> > However, to do this I need to issue a "set identity_insert tablename
> on"
> > before the actual insert statement is executed?
> >
> > I did this in the afterInsert method of my BrokerAware persistence
> object as
> > follows:
> >
> > Connection conn = getConnection();
> >
> > stmt = conn.createStatement();
> >
> > stmt.execute("set identity_insert mcsp_test on");
> >
> > stmt.close();
> >
> >
> >
> > Although the set statment was executed successfully, when the
> persistence
> > broker issued the insert command, it still failed.
> >
> > afterInsert
> >
> > 1057255340516|0|1|statement||set identity_insert mcsp_test on
> >
> > 1057255340516|0|0|batch|INSERT INTO mcsp_test (id,col1) VALUES (?,?)
> |INSERT
> > INTO mcsp_test (id,col1) VALUES ('97','a13')
> >
> > 1057255340531|15|0|statement|INSERT INTO mcsp_test (id,col1) VALUES
> (?,?)
> > |INSERT INTO mcsp_test (id,col1) VALUES ('97','a13')
> >
> > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
> Commit on
> > underlying connection failed, try to rollback
> >
> > JZ0BE: BatchUpdateException: Error occurred while executing batch
> statement:
> > Explicit value specified for identity field in table 'mcsp_test' when
> > IDENTITY_INSERT is set to OFF.
> >
> >
> >
> >
> >
> > I'm not sure why. Perhaps it was issued on another connection in my
> pool
> > but this still fails even for a singleton connection.
> >
> > Is there a way I can override how the persistence broker is
> implementing the
> > insert statement?
> >
> > Or is there a way I can customize the insert statement to issue a "set
> > command"?
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
Re: How do I customize insert for Sybase identity columns?
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Brain,
use another SM implementation (e.g. SequenceManagerInMemoryImpl)
or implement your own SequenceManager.
HiLo-SM implementation use intern a new connection (because
we want to avoid 'rollback trouble'), thus your setting is made
on the wrong connection.
regards,
Armin
----- Original Message -----
From: "Brian Chaplin" <bc...@chaplinsolutions.com>
To: <oj...@db.apache.org>
Sent: Thursday, July 03, 2003 8:17 PM
Subject: How do I customize insert for Sybase identity columns?
> I'm trying to handle sybase and SQL Server identity columns by
allowing OJB
> to control the sequence number generation through the
> SequenceManagerHighLowImpl.
>
> However, to do this I need to issue a "set identity_insert tablename
on"
> before the actual insert statement is executed?
>
> I did this in the afterInsert method of my BrokerAware persistence
object as
> follows:
>
> Connection conn = getConnection();
>
> stmt = conn.createStatement();
>
> stmt.execute("set identity_insert mcsp_test on");
>
> stmt.close();
>
>
>
> Although the set statment was executed successfully, when the
persistence
> broker issued the insert command, it still failed.
>
> afterInsert
>
> 1057255340516|0|1|statement||set identity_insert mcsp_test on
>
> 1057255340516|0|0|batch|INSERT INTO mcsp_test (id,col1) VALUES (?,?)
|INSERT
> INTO mcsp_test (id,col1) VALUES ('97','a13')
>
> 1057255340531|15|0|statement|INSERT INTO mcsp_test (id,col1) VALUES
(?,?)
> |INSERT INTO mcsp_test (id,col1) VALUES ('97','a13')
>
> [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
Commit on
> underlying connection failed, try to rollback
>
> JZ0BE: BatchUpdateException: Error occurred while executing batch
statement:
> Explicit value specified for identity field in table 'mcsp_test' when
> IDENTITY_INSERT is set to OFF.
>
>
>
>
>
> I'm not sure why. Perhaps it was issued on another connection in my
pool
> but this still fails even for a singleton connection.
>
> Is there a way I can override how the persistence broker is
implementing the
> insert statement?
>
> Or is there a way I can customize the insert statement to issue a "set
> command"?
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>