db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter S. Hamlen" <pham...@mail.com>
Subject Re: transactions have just suddenly stopped working
Date Thu, 16 Jan 2003 22:20:37 GMT
Caolite,

Well, off the top of my head:

1)  The evidence suggests that the connection is invalid for some reason
- I'm not exactly sure why.

2)  Has anyone changed the torque config file recently?  That would be
my first place to look.

3)  Possibly try a different way of writing it.  For instance:

    Connection conn = Torque.getConnection();
    userAccount.save(conn);

    (Admittedly, I use 3-b2 so this might no longer work in the real
release.)

4)  Take the connection that you've get, and try executing a query using
a criteria:
   Connection torqueCon =
Transaction.begin(UserAccountPeer.DATABASE_NAME);
   Criteria crit = new Criteria();
   crit.add(UserAccountPeer.USERNAME, "foo");
   List theList = UserAccountPeer.doSelect(crit, torqueCon);

   See if that one fails to.

Hope some of these help...

-Peter   

On Thu, 2003-01-16 at 12:32, Caoilte O'Connor wrote:
> Hi,
> I'm having a little trouble with my transactions.
> 
> I'm running Torque 3.0, Postgresql 7.2.1 (debian) and had transactions
> working fine until a couple of days ago. They've suddenly just stopped
> working though, and I was wandering if anyone had any idea why that
> could be.
> 
> I do a
> 
> Connection torqueCon = Transaction.begin(UserAccountPeer.DATABASE_NAME);
> 
> which works, and the connection exists. However whenever I do something
> like,
> 
> userAccount.save(torqueCon);
> 
> I get the following error,
> 
> java.lang.NullPointerException
>         at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:673)
>         at
> net.sportplan.BaseUserAccountPeer.doInsert(BaseUserAccountPeer.java:259)
>         at
> net.sportplan.BaseUserAccountPeer.doInsert(BaseUserAccountPeer.java:586)
>         at net.sportplan.BaseUserAccount.save(BaseUserAccount.java:3226)
>         at
> net.sportplan.all.util.VoucherUtilityBean.generateThemedVouchers(VoucherUtilityBean.java:569)
>         at
> net.sportplan.admin.action.CreateThemedVouchersAction.perform(CreateThemedVouchersAction.java:101)
>         at org.apache.struts.action.Action.execute(Action.java:369)
>         at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:437)
>         at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:264)
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
>         at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:470)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:431)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
>         at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:537)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
>         at java.lang.Thread.run(Thread.java:536)
> 
> 
> I've had a look at the source and it doesn't seem to directly relate to
> the fact that I am doing transactions. However as soon as I change the
> line to,
> 
> userAcc.save();
> 
> it works. I kinda need transactions, so that is not a long term
> solution. Does anyone know why torque could suddenly be borking so
> unexpectedadly? As I said, exactly the same code was working fine until
> very recently.
> 
> thx,
> 
> -- 
> Caoilte O'Connor <me@caoilte.org>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-torque-user-help@jakarta.apache.org>
> 



Mime
View raw message