Re: CCM - Transactions. Please Help!!
Randy Graebner <[email protected]> Fri, 14 May 2004 11:49:04 -0400
| Newsgroups | gmane.linux.redhat.ccm.general |
|---|---|
| Message-ID | <[email protected]> |
srini wrote: >Here is what I do in my web app: > >1. Whenever a logged in user submits a job, I create an JOB instance > in the database (using domain object), do an explicit disconnect > of this instance and put into a Job Queue (in memory) > >2. A thread monitors this Job Queue and processes each job in the queue. > Since the stored job instances (in the queue are READ ONLY), I then > retrieve the job details again from the database using this > READ ONLY object's ID. That is when I run into this exception. > > (IMPORTANT: I can see the job details in the database) > > > > Is it possible that the thread has its own transaction and is actually opening the transaction before the domain object transaction is committed? In that situation, the line will appear in the DB but may not be available to the background thread. The reason that we are thinking that there may be an overlapping transaction or some other issue like that (and not necessarily a problem with the disconnect() call) is that when you call "get" on an object that has lost its transaction then you get a different error...one that explicitly states that that the transaction is lost...it sounds like you are getting the error before the creation transaction has committed. Randy > >-----Original Message----- >From: Vadim Nasardinov [mailto:[email protected]] >Sent: Friday, May 14, 2004 9:44 AM >To: srini; [email protected] >Subject: Re: [redhat-ccm-list] CCM - Transactions. Please Help!! > >On Friday 14 May 2004 10:35, srini wrote: > > >>The other transaction is opened from within a Thread. Would >>that make any difference? >> >> > >What do you mean by that? > >IIRC, the way things are set up is that each thread gets its own >Session. Barring possible rare edge cases, there is a one-to-one >mapping between threads and sessions. > >Regardless, if a domain object has been successfully saved, you >shouldn't be getting a DataObjectNotFoundException with the code >you've shown. > >It might be a good idea for you to share a little more details of your >exact setup and/or tell us about your attempts to debug this on your >own. People on this list may get a clue from what you say or forget >to say. > > > > -- Redhat-ccm-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/redhat-ccm-list Archives: https://www.redhat.com/pipermail/redhat-ccm-list/