Re: Committed updates don't seem to be committed.

From: Frank Kurzawa <fkurzawa(at)topazsoftware(dot)com>
To: mike(at)thegodshalls(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Committed updates don't seem to be committed.
Date: 2004-06-23 04:57:49
Message-ID: DFE39DB7-C4D1-11D8-8567-00039366F1F4@topazsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thanks Mike,
I'll post more details when I'm back in the office tomorrow. I didn't
put too much detail in my initial question because often the long,
convoluted questions scare off people from answering them. <sorry>
In the meantime:

I'm using Hibernate, which is a java-based Object-Relational mapper
(http://www.hibernate.org). It's a great tool, and becoming very
popular in java-based web app developers.
Hibernate generates the sql queries based on the O/R mapping that I've
defined. It in turn uses the postgres JDBC driver to communicate those
queries to postgres. Hibernate has API's for session management and
transaction management. I currently open one hibernate session for the
duration of a single http request. The session loosely corresponds to a
database connection that is opened when the session opens and is
flushed and closed when the session closes when the http request has
been handled. Although hibernate may cache sequel commands until the
flush and close, I've verified that the flush and close are taking
place and that the commands are being executed by the database (e.g.
the update that I showed you in the log.

Although Hibernate also has a transaction API, we are not using it in
most cases because in most cases our database interactions are already
largely atomic in nature.

You ask some specific questions about this particular update, but let
me point out, that this is not a single isolated instance. It's
happening with most any INSERT or UPDATE, and yes, I have verified that
the commands really are legal in the context of the data in the
database. I.e. the INSERTs are failing as well, and the UPDATEs really
are relating to rows that are actually in the database.

More detail to come tomorrow.

Regards,

Frank

On Jun 22, 2004, at 10:06 PM, mike g wrote:

>
>> 1. If I update from the web-app, then the results of those updates
>> appear in the webapp until it is restarted (i.e. the database
>> connection
>> is terminated). After restart, it is as if the updates did not
>> occur.the
>>
> I have worked with one application that stored current data in an array
> which is what was displayed on the screen to the user. Updates,
> deletes
> etc would update the array, send a sql statement to the database, but
> repaint the screen with the info stored in the array. Every once in a
> while something would go array (sorry for the bad pun) and what you saw
> on the screen was not what you saw in the database until you closed the
> application and reopened it. Then it displayed what was in the
> database
> usually to the dismay of the user and me.
>
> The log below does show postgresql received an update sql statement.
> Does CTaskTID of 1183... truly already exist in the database? Is that
> column a text or varchar field by chance that might have some extra
> white spaces that are preventing it from finding a match?
>
> Can't tell what language you are using to connect to the db but I
> believe the docs have some detail on how one can have postgres return
> the number of rows affected after issuing a sql statement. Kind of
> sounds like the app could use a few more error checking routines
> perhaps.
>
> If you post more details about how the transaction being executed you
> might get more replies from others on the list. Pretty tough to give a
> definitive answer based on the info below.
>
> Mike

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-06-23 05:20:15 Re: Committed updates don't seem to be committed.
Previous Message Frank Kurzawa 2004-06-23 04:28:49 Re: Committed updates don't seem to be committed.