errors while getting large objects... - Mailing list pgsql-jdbc

From chris markiewicz
Subject errors while getting large objects...
Date
Msg-id 017a01c11b9e$faef6420$77b846c6@cmarkiewicz
Whole thread Raw
In response to RE: Large Objects  ("chris markiewicz" <cmarkiew@commnav.com>)
Responses hangs while getting large objects...
List pgsql-jdbc
hello.

my application uses large objects frequently...to render the main page, it
might load anywhere from zero to 10 large objects - mostly images or
documents.  recently i started stress testing this page (making it always
load many LOs) and i frequently encounter two different problems.

1. fastpath - autocommit is always false...i've verified this several times.
my current workaround is to catch the fastpath error and resubmit the
query...usually works on the second pass and rarely makes it to 4 passes
(the current limit i have set).  i have included a stack trace at the bottom
of this message.  does anyone have any ideas on this?  i'm using 7.0.2 with
the 7.0-1.2 jdbc driver.  the occurences seem totally random...sometimes a
page loads perfectly, sometimes i get three fastpath errors...sometimes the
first load gets FP erros, sometimes the fifth page does.

2. hanging - i recently noticed that the processing sometimes (pretty
frequently) hangs on the line of code that grabs the LO from the db...i've
tried both:

byte[] bytes = rs.getBytes(columnName);
 and
InputStream is = rs.getBinaryStream(columnName);

Same result for both.  It hangs indefinitely.  Similar to the fastpath -
sometimes it happens, sometimes it doesn't...but it always happens within 5
screen loads of my stress test page.

does anyone know if these problems were fixed in recent versions of
postgresql?  is anyone having similar problems?  i greatly appreciate any
help!

thanks
chris






FastPath call returned ERROR:  lo_tell: invalid large object descriptor (0)

    at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:141)
    at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:191)
    at org.postgresql.fastpath.Fastpath.getInteger(Fastpath.java:203)
    at org.postgresql.largeobject.LargeObject.tell(LargeObject.java:232)
    at org.postgresql.largeobject.LargeObject.size(LargeObject.java:247)
    at org.postgresql.jdbc2.ResultSet.getBytes(ResultSet.java:370)
    at org.postgresql.jdbc2.ResultSet.getBinaryStream(ResultSet.java:514)
    at org.postgresql.jdbc2.ResultSet.getBinaryStream(ResultSet.java:616)
    at
com.commnav.sbh.framework.persist.JDBCEngine.loadResultSet(JDBCEngine.java:4
40)
    at com.commnav.sbh.framework.persist.JDBCEngine.load(JDBCEngine.java:284)
    at
com.commnav.sbh.framework.persist.PersistenceObject.load(PersistenceObject.j
ava:169)
    at
com.commnav.sbh.framework.documentmanager.SBHDocument.loadComplex(SBHDocumen
t.java:586)
    at
com.commnav.sbh.framework.persist.PersistenceObject.load(PersistenceObject.j
ava:208)
    at
com.commnav.sbh.applications.documentmanager.FavoriteDocumentIteratorTag.doS
tartTag(FavoriteDocumentIteratorTag.java:56)
    at
apps.favorited_00025cuments._0002fapps_0002ffavoritedocuments_0002ffavorited
ocumentspidget_0002ejspfavoritedocumentspidget_jsp_24._jspService(_0002fapps
_0002ffavoritedocuments_0002ffavoritedocumentspidget_0002ejspfavoritedocumen
tspidget_jsp_24.java:392)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at
org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl
.java:345)
    at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
    at
_0002fdesktop_0002ejspdesktop_jsp_130._jspService(_0002fdesktop_0002ejspdesk
top_jsp_130.java:601)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at
org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl
.java:194)
    at
com.commnav.sbh.framework.navigation.handlers.NavigationHandlerImpl.execute(
NavigationHandlerImpl.java:39)
    at
com.commnav.sbh.framework.navigation.Navigator.navigate(Navigator.java:80)
    at com.commnav.sbh.servlets.ControlServlet.doPost(ControlServlet.java:132)
    at com.commnav.sbh.servlets.ControlServlet.doGet(ControlServlet.java:63)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
    at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)


pgsql-jdbc by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: JDBC and blobs
Next
From: Bruce Momjian
Date:
Subject: Re: Re: What needs to be done?