John Thorhauer wrote:
>
> I think I got everything set up right but I and now I get the following
> error:
>
> ##################################################
> Exception: FastPath call returned ERROR: lo_write: invalid large obj
> descriptor (0)
This error is caused by the fact that manipulation of large object data
in Postgres must be done within a transaction. Jon, how would you feel
about putting something like this in BasePeer.doUpdate:
//put this right after we get the connection from the broker
if ( TurbineResources.getString("database.default.driver", "" )
.startsWith("org.postgres") )
{
try
{
Statement state = conn.createStatement();
state.executeQuery("BEGIN TRANSACTION");
state.close();
}
catch (SQLException e) {}
}
//put this in the finally before we release the connection from
the broker
if ( TurbineResources.getString("database.default.driver", "" )
.startsWith("org.postgres") )
{
try
{
Statement state = conn.createStatement();
state.executeQuery("COMMIT TRANSACTION");
state.close();
}
catch (SQLException e) {}
}
>
> at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:141)
> at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:191)
> at
> org.postgresql.largeobject.LargeObject.write(LargeObject.java:173)
> at
> org.postgresql.jdbc2.PreparedStatement.setBytes(PreparedStatement.java:300)
> at
> com.workingdogs.village.Value.setPreparedStatementValue(Value.java:253)
> at
> com.workingdogs.village.Record.saveWithUpdate(Record.java:262)
> at com.workingdogs.village.Record.save(Record.java:187)
> at com.workingdogs.village.Record.save(Record.java:166)
> at
> org.apache.turbine.om.peer.BasePeer.insertOrUpdateRecord(BasePeer.java:686)
> at
> org.apache.turbine.om.peer.BasePeer.doUpdate(BasePeer.java:1116)
> at
> org.apache.turbine.om.user.peer.TurbineUserPeer.doUpdate(TurbineUserPeer.java:324)
> at
> org.apache.turbine.om.user.TurbineUser.saveToStorage(TurbineUser.java:563)
> at
> org.apache.turbine.modules.actions.LogoutUser.doPerform(LogoutUser.java:88)
> at org.apache.turbine.modules.Action.perform(Action.java:77)
> at
> org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:111)
> at
> org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:79)
> at org.apache.turbine.modules.Page.build(Page.java:81)
> at
> org.apache.turbine.modules.PageLoader.exec(PageLoader.java:111)
> at Turbine.doGet(Turbine.java:318)
> at Turbine.doPost(Turbine.java:388)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
> at
> org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
> at
>
>org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
> at
> org.apache.tomcat.service.TcpWorkerThread.run(PoolTcpEndpoint.java:366)
> at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:411)
> at java.lang.Thread.run(Thread.java:475)
> ###################################################
>
> Do I have to do something else in postgres for oid type fields?
>
> John
> --
> ********************************
> ** John Thorhauer
> ** Web Developer
> ** Phoenix Color Corp.
> ** [EMAIL PROTECTED]
> ********************************
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]