I'm finding that starting a transaction, issuing a lot of updates,
then committing a transaction sometimes fails to return a constraints violation error that causes the commit to fail. Logging the sql and pasting it into the psql shell definitely displays the error - which occurs as a result of sending 'commit transaction' as the constraints are all set to deferred. Has anybody else noticed this or am I special? |
Do you have an example of the code that I can try here? Are you using the
postgres2 client, or the regular client? What version of postgreSQL are you using? Ron Teitelbaum > -----Original Message----- > From: [hidden email] [mailto:squeak-dev- > [hidden email]] On Behalf Of Todd Blanchard > Sent: Thursday, March 08, 2007 1:30 PM > To: The general-purpose Squeak developers list > Subject: PostgresSQL connector fails to report some errors? > > I'm finding that starting a transaction, issuing a lot of updates, > then committing a transaction sometimes fails to return a constraints > violation error that causes the commit to fail. Logging the sql and > pasting it into the psql shell definitely displays the error - which > occurs as a result of sending 'commit transaction' as the constraints > are all set to deferred. > > Has anybody else noticed this or am I special? > |
postgres2, I don't have sample code because you'd need the whole data
model with constraints and I haven't quite managed to produce a reproduceable case that doesn't involve sending the whole database. The db contains confidential information so I can't send that off. So it is postgres2, using glorp, on Squeak 3.7. I have noticed glorp doesn't catch errors on commit and changed it - but the error is not showing up in the result from the connection. -Todd Blanchard On Mar 8, 2007, at 10:53 AM, Ron Teitelbaum wrote: > Do you have an example of the code that I can try here? Are you > using the > postgres2 client, or the regular client? What version of > postgreSQL are you > using? > > Ron Teitelbaum > >> -----Original Message----- >> From: [hidden email] [mailto:squeak- >> dev- >> [hidden email]] On Behalf Of Todd Blanchard >> Sent: Thursday, March 08, 2007 1:30 PM >> To: The general-purpose Squeak developers list >> Subject: PostgresSQL connector fails to report some errors? >> >> I'm finding that starting a transaction, issuing a lot of updates, >> then committing a transaction sometimes fails to return a constraints >> violation error that causes the commit to fail. Logging the sql and >> pasting it into the psql shell definitely displays the error - which >> occurs as a result of sending 'commit transaction' as the constraints >> are all set to deferred. >> >> Has anybody else noticed this or am I special? >> > > > |
Hi Todd,
I'm sorry I don't think I can help. I was just looking at what I'm running. I remember you talking about those changes, but it appears that I'm using some previous version of Glorp. It's embarrassing but I don't even know what version I'm running. I had to make some changes to get the postgres2 client running on squeak 3.9. I posted a bug with the changes in mantis and sourceforge. The problem is I didn't copy the original versions into my repository and now I'm on my own version 4. I really need to go back and figure it out and load the new squeak port to try it out. I'm guessing my version doesn't report the errors at all. Sorry. Please keep us informed if you figure out the problem or if you have a reproducible example, I'd be happy to try it out and help you debug it. Ron > From: Todd Blanchard > Sent: Thursday, March 08, 2007 2:01 PM > > postgres2, I don't have sample code because you'd need the whole data > model with constraints and I haven't quite managed to produce a > reproduceable case that doesn't involve sending the whole database. > The db contains confidential information so I can't send that off. > > So it is postgres2, using glorp, on Squeak 3.7. I have noticed glorp > doesn't catch errors on commit and changed it - but the error is not > showing up in the result from the connection. > > -Todd Blanchard > > On Mar 8, 2007, at 10:53 AM, Ron Teitelbaum wrote: > > > Do you have an example of the code that I can try here? Are you > > using the > > postgres2 client, or the regular client? What version of > > postgreSQL are you > > using? > > > > Ron Teitelbaum > > > >> -----Original Message----- > >> From: [hidden email] [mailto:squeak- > >> dev- > >> [hidden email]] On Behalf Of Todd Blanchard > >> Sent: Thursday, March 08, 2007 1:30 PM > >> To: The general-purpose Squeak developers list > >> Subject: PostgresSQL connector fails to report some errors? > >> > >> I'm finding that starting a transaction, issuing a lot of updates, > >> then committing a transaction sometimes fails to return a constraints > >> violation error that causes the commit to fail. Logging the sql and > >> pasting it into the psql shell definitely displays the error - which > >> occurs as a result of sending 'commit transaction' as the constraints > >> are all set to deferred. > >> > >> Has anybody else noticed this or am I special? > >> > > > > > > > |
Ron Teitelbaum wrote:
> I had to make some changes to get the postgres2 client running on squeak > 3.9. I posted a bug with the changes in mantis and sourceforge. The > problem is I didn't copy the original versions into my repository and now > I'm on my own version 4. I really need to go back and figure it out and > load the new squeak port to try it out. The SqueakSource repository for PostgresV2 is world writable, so anyone should be able upload new/fixed versions. > I'm guessing my version doesn't report the errors at all. Sorry. Please > keep us informed if you figure out the problem or if you have a reproducible > example, I'd be happy to try it out and help you debug it. A test case would certainly be useful. I'm not currently a user of Glorp, so I can't speculate on its error handling. Have you tried submitting your logged SQL statements through the PostgresV2 client? The TestPGConnection class should have code you can adapt to send a sequence of SQL. One thing to note is that the frontend/backend communication is event-driven. It wouldn't surprise me if an error message were to take a long time to arrive at the client, given the scenario that was outlined (db with some constraints, begin, lots of updates, and then commit). IIRC, the backend should not respond with a packet that indicates it's ready to accept a new SQL stmt, following the commit, until it is ready. But, there's no guarantee that an error message from the previous statement will be returned, before the ready for next query packet is sent. The PGConnection public api is a synchronous overlay on top of the underlying event-driven state-machine. I seem to recall that in some cases error message packets get written to the Transcript, but I'd have to check the code to refresh my memory. HTH. -- Yanni Chiu |
Free forum by Nabble | Edit this page |