Subject | Re: FBResourceException |
---|---|
Author | jplsaez |
Post date | 2003-07-31T21:46:10Z |
Hi,
anybody know how to do it with DBCP?
What about using FBWrappingDataSource? I have tested my problem whit
it and it keep the same, so, is there any way to discard connections
with this pooling mechanism?
What does it exactly mean to use the built-in jca connection pooling?
Can I use it with Tomcat or do I need a full J2EE application server?
I could argue that after receiving a FBResourceEception, because of
any cause, the connection becomes "corrupted" and it's necessary to
close it. So a FBResourceEception can be considered a fatal exception
in any case. The question is: why is this exception thrown?
Thanks.
Juan Pedro Lopez
3)
)
nection.java:187)
:146)
204)
nFilterChain.java:247)
hain.java:193)
va:103)
nFilterChain.java:213)
hain.java:193)
5)
nFilterChain.java:213)
hain.java:193)
t.java:77)
nFilterChain.java:213)
hain.java:193)
ava:260)
keNext(StandardPipeline.java:643)
)
ava:191)
keNext(StandardPipeline.java:643)
0)
keNext(StandardPipeline.java:643)
.java:170)
keNext(StandardPipeline.java:641)
2)
keNext(StandardPipeline.java:641)
a:174)
keNext(StandardPipeline.java:643)
ection(Http11Protocol.java:386)
va:530)
3)
)
nection.java:187)
204)
.java:684)
her.java:432)
r.java:356)
204)
nFilterChain.java:247)
hain.java:193)
va:103)
nFilterChain.java:213)
hain.java:193)
t.java:77)
nFilterChain.java:213)
hain.java:193)
ava:260)
keNext(StandardPipeline.java:643)
ava:191)
keNext(StandardPipeline.java:643)
0)
keNext(StandardPipeline.java:643)
.java:170)
keNext(StandardPipeline.java:641)
2)
keNext(StandardPipeline.java:641)
a:174)
keNext(StandardPipeline.java:643)
ection(Http11Protocol.java:386)
va:530)
> After you have shut down the db, you need to discard all thepre-existing
> connections in the pool. If there is no way to do this with DBCPyou could
> consider using the built in jca based connection pooling which shouldSo, if the solution is discarding pre-existing connections, does
> discard connections if there is a fatal error (such as the db being shut
> down).
>
anybody know how to do it with DBCP?
What about using FBWrappingDataSource? I have tested my problem whit
it and it keep the same, so, is there any way to discard connections
with this pooling mechanism?
What does it exactly mean to use the built-in jca connection pooling?
Can I use it with Tomcat or do I need a full J2EE application server?
I could argue that after receiving a FBResourceEception, because of
any cause, the connection becomes "corrupted" and it's necessary to
close it. So a FBResourceEception can be considered a fatal exception
in any case. The question is: why is this exception thrown?
Thanks.
Juan Pedro Lopez
>a new
> On 2003.07.31 04:05 Juan Pedro López Sáez wrote:
> > Hello all,
> >
> > I'm using Jaybird 1.0 and Firebird 1.0.3 in a Linux Machine.
> >
> > I've a JSP web application that access a Firebird database by means of
> > DBCP pooling mechanism. The database pool is set up in the init method
> > of a servlet filter (GetDbConnection). Every new http request gets
> > connection from the pool in the doFilter method of the samefilter. The
> > filter passes the connection as a request attribute, so every JSPin my
> > web application can retrieve it when needed. Finally, theconnection is
> > released to the pool, after the chain.doFilter method of the filter,shut
> > performing a java.sql.Connection.close(). Every Statement is closed in
> > the web application so the connection is supposed to be correcly
> > released to the pool.
> >
> > This schema seems to work fine, but I have a problem. Sometimes I have
> > to shutdown the database to perform some manteinance tasks. If the web
> > application tries to connect meanwhile, it gets a new connection from
> > the pool. When it calls java.sql.Connection.prepareStatement(String),
> > an FBResourceEception is thrown as it is expected (the database in
> > down). The problem is the web application can't ever succeed calling aline.
> > conn.prepareStatement(strSel), even if the database is brought on
> > It gets new connections from the pool, butcan't
> >
> > org.firebirdsql.jca.FBResourceException: local transaction active:
> > begin anothercorruption.
> >
> > is thrown again a again after every prepareStatement call.
> >
> > I must reload the web application in order to make things work.
> >
> > I think the problem is related to a kind of connection state
> > After the first exception, because of the database shutdown,connection
> > is released to the pool but it keeps in a wrong state. When the nextdatabase pool
> > request retrieves the same pooled connection, it gets the
> > FBResourceException. When the application is reloaded, tha
> > is restarted, so new database connections are in a correct state.org.firebirdsql.jdbc.FBConnection.ensureInTransaction(FBConnection.java:100=
> >
> > I have tested the same situation without pooled connections. After the
> > first exception, connection is closed. When the database is again on
> > line, new connections are error free and everything works fine.
> >
> > See below the web application's stack trace.
> >
> > Thank you in advance.
> >
> > Juan Pedro Lopez
> >
> >
> > 2003-07-29 20:50:36,664 FATAL com.altiria.wasp.mktSMS.beans.Promotion
> > Client:1 User:1 sId:9625C9334E83704AB0B018DAFB3C0B4E - .getBasicPromo:
> > Exception searching for K_PROMOTION field.
> > java.sql.SQLException: ResourceException:
> > org.firebirdsql.jca.FBResourceException: database
> > /var/lib/firebird/data/test_mktsms_R_1_0.gdb shutdown
> > Reason: database /var/lib/firebird/data/test_mktsms_R_1_0.gdb shutdown
> > at
> >
3)
> > atorg.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:77=
> >
)
> > atorg.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:243)
> >
> > atorg.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingCon=
> >
nection.java:187)
> > atcom.altiria.wasp.mktSMS.beans.Promotion.getBasicPromo(Promotion.java:834)
> >
> > atorg.apache.jsp.instantPushSimple_jsp._jspService(instantPushSimple_jsp.java=
> >
:146)
> > atorg.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:=
> > at
> >
204)
> > atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> >
> > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio=
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
nFilterChain.java:247)
> > atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC=
> >
hain.java:193)
> > atcom.altiria.wasp.mktSMS.filters.GetDbConnection.doFilter(GetDbConnection.ja=
> >
va:103)
> > atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio=
> >
nFilterChain.java:213)
> > atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC=
> >
hain.java:193)
> > atcom.altiria.wasp.mktSMS.filters.CheckActivity.doFilter(CheckActivity.java:5=
> >
5)
> > atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio=
> >
nFilterChain.java:213)
> > atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC=
> >
hain.java:193)
> > atcom.altiria.wasp.mktSMS.filters.SetLoggingContext.doFilter(SetLoggingContex=
> >
t.java:77)
> > atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio=
> >
nFilterChain.java:213)
> > atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC=
> >
hain.java:193)
> > atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j=
> >
ava:260)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:643)
> > atorg.apache.catalina.core.StandardPipeline.0invoke(StandardPipeline.java:480=
> >
)
> > atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j=
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > at
> >
ava:191)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:643)
> > atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)=
> >
> > atorg.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > at
> >
> > atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:18=
> >
0)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:643)
> > atorg.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve=
> >
.java:170)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:641)
> > atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:17=
> >
2)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:641)
> > atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)=
> >
> > atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav=
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > at
> >
a:174)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:643)
> > atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)=
> >
> > atorg.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > at
> >
> > atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
> >
> > atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConn=
> >
ection(Http11Protocol.java:386)
> > atorg.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
> >
> > atorg.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja=
> >
va:530)
> > at java.lang.Thread.run(Thread.java:536)shown.
> > 2003-07-29 20:50:38,490 DEBUG com.altiria.wasp.mktSMS.beans.User
> > Client:1 User:1 sId:9625C9334E83704AB0B018DAFB3C0B4E - In error.jsp
> > 2003-07-29 20:50:38,490 ERROR com.altiria.wasp.mktSMS.beans.User
> > Client:1 User:1 sId:9625C9334E83704AB0B018DAFB3C0B4E - Error page
> > 2003-07-29 20:50:38,491 DEBUGClient:
> > com.altiria.wasp.mktSMS.filters.GetDbConnection Client:1 User:1
> > sId:9625C9334E83704AB0B018DAFB3C0B4E - GetDbConnection: Connection
> > closed.
> > 2003-07-29 20:50:38,491 DEBUG
> > com.altiria.wasp.mktSMS.filters.SetLoggingContext Client:1 User:1
> > sId:9625C9334E83704AB0B018DAFB3C0B4E - SetLoggingContext: Removed
> > logging context
> >
> > ------ Now database in on line --------
> >
> > 2003-07-29 20:52:00,083 DEBUG
> > com.altiria.wasp.mktSMS.filters.GetDbConnection Client: User: sId: -
> > GetDbConnection: Connection opened
> > 2003-07-29 20:52:00,088 DEBUG com.altiria.wasp.mktSMS.beans.User
> > User: sId: - Enter isClientValidClient:
> > 2003-07-29 20:52:00,088 FATAL com.altiria.wasp.mktSMS.beans.User
> > User: sId: - .isClientValid: Exception checking client id.can't
> > java.sql.SQLException: ResourceException:
> > org.firebirdsql.jca.FBResourceException: local transaction active:
> > begin anotherorg.firebirdsql.jdbc.FBConnection.ensureInTransaction(FBConnection.java:100=
> > Reason: local transaction active: can't begin another
> > at
> >
3)
> > atorg.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:77=
> >
)
> > atorg.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:243)
> >
> > atorg.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingCon=
> >
nection.java:187)
> > at com.altiria.wasp.mktSMS.beans.User.isClientValid(User.java:453)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
> > at org.apache.jsp.dirlogin_jsp._jspService(dirlogin_jsp.java:84)
> > at
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:=
> > at
> >
204)
> > atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> >
> > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher=
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
.java:684)
> > atorg.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatc=
> >
her.java:432)
> > atorg.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatche=
> >
r.java:356)
> > atorg.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)=
> >
> > at org.apache.jsp.index_jsp._jspService(index_jsp.java:52)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
> > at
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:=
> > at
> >
204)
> > atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> >
> > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio=
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
nFilterChain.java:247)
> > atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC=
> >
hain.java:193)
> > atcom.altiria.wasp.mktSMS.filters.GetDbConnection.doFilter(GetDbConnection.ja=
> >
va:103)
> > atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio=
> >
nFilterChain.java:213)
> > atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC=
> >
hain.java:193)
> > atcom.altiria.wasp.mktSMS.filters.SetLoggingContext.doFilter(SetLoggingContex=
> >
t.java:77)
> > atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio=
> >
nFilterChain.java:213)
> > atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC=
> >
hain.java:193)
> > atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j=
> >
ava:260)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:643)
> > atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)=
> >
> > atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j=
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > at
> >
ava:191)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:643)
> > atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)=
> >
> > atorg.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > at
> >
> > atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:18=
> >
0)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:643)
> > atorg.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve=
> >
.java:170)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:641)
> > atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:17=
> >
2)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:641)
> > atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)=
> >
> > atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav=
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > at
> >
a:174)
> > atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo=
> >
keNext(StandardPipeline.java:643)
> > atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)=
> >
> > atorg.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > at
> >
> > atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
> >
> > atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConn=
> >
ection(Http11Protocol.java:386)
> > atorg.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
> >
> > atorg.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja=
> >
va:530)
> > at java.lang.Thread.run(Thread.java:536)Client:
> > 2003-07-29 20:52:01,198 ERROR com.altiria.wasp.mktSMS.beans.User
> > User: sId: - Error page shownhttp://docs.yahoo.com/info/terms/
> > 2003-07-29 20:52:01,199 DEBUG
> > com.altiria.wasp.mktSMS.filters.GetDbConnection Client: User: sId: -
> > GetDbConnection: Connection closed.
> > 2003-07-29 20:52:01,199 DEBUG
> > com.altiria.wasp.mktSMS.filters.SetLoggingContext Client: User: sId: -
> > SetLoggingContext: Removed logging context
> >
> > --
> > Juan Pedro López Sáez
> > ALTIRIA TIC, S.L.L.
> > www.altiria.com
> >
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > Firebird-Java-unsubscribe@yahoogroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> >
> >
> >
> >