[Pljava-dev] Question regarding triggers and data visibility

Burtenshaw, John J. JBurtenshaw at cooperstandard.com
Fri Nov 11 21:57:32 UTC 2005


Thanks for the quick reply Rakesh.  It turns out I was not using
transaction blocks (i.e. allowing "autocommit") so I just tried the
insert statement in a Begin/commit block and it did not make a
difference.  Any other ideas as to what could cause this strange
phenomena?

 

Regards,

John Burtenshaw

 

 

________________________________

From: Rakesh Vidyadharan [mailto:rakesh at rakeshv.org] 
Sent: Friday, November 11, 2005 4:32 PM
To: Burtenshaw, John J.
Subject: Re: [Pljava-dev] Question regarding triggers and data
visibility

 

 

On Nov 11, 2005, at 3:27 PM, Burtenshaw, John J. wrote:





I have created a trigger that notifies a daemon process (via the java
RMI mechanism) that a new record has been inserted into a table.  The
problem I am having is that the record is not visible to the daemon
process after it performs a 'select' on the table in question.  Further
investigation shows that the new record was successfully inserted into
the table.  The strange thing is that if I do a table lock (i.e. 'lock
table') in the trigger method before notifying the daemon the data
becomes visible to the daemon!!  I don't like using the lock as I have
had issues with the lock causing random problems.  Any ideas as to how I
can make the new data visible?

That sounds like a transaction commit issue to me.  If the insert has
not been committed, then another connection will not be able to see the
record.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/pljava-dev/attachments/20051111/5c51d78a/attachment.html 


More information about the Pljava-dev mailing list