agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] After an insert, the trigger can't find the row
Date: Fri, 26 Aug 2005 10:24:38 +0200
Message-ID: <430ED1C6.10603@insa-toulouse.fr> (raw)

Hello,

My ddr configuration is :
AFTER INSERT ON exploitation.groupe
FOR EACH ROW
EXECUTE PROCEDURE exploitation.alloTrigger();


In my trigger, i would like to do a select to be sure the row is in my 
db (because the trigger is fired before the commit if we are in a 
transaction).
So, I have in my class fired by trigger a select on my new row.
------------------------------------------------------------------------------------
rsTrigger=td.getNew();
                           
System.out.println("ID "+rsTrigger.getString(1));
                           
int gid_number=rsTrigger.getInt(1);
                           
query="Select * from exploitation.groupe where gid_number="+gid_number;
rs = select.executeQuery(query);
                           
                           
System.out.println("Begin");
                            while (rs.next()) {
                                System.out.println("nb ="+rs.getString(1));
                            }
System.out.println("End");
----------------------------------------------------------------------------------------

I have this info in the log :
ID 170
Select * from exploitation.groupe where gid_number=170
Debut
Fin

--------------------------------------
And the class don't find the last row in the database.
If I launch a select by hand, i find this last row :
SELECT * from exploitation.groupe where gid_number=170;
 gid_number | lib_groupe | lic_groupe
------------+------------+------------
        170 | a          | b
(1 ligne)


I suppose the row is really inserted in the bd after the execution of 
the trigger !


Can you help me please ...
Eric





view thread (2+ messages)  latest in thread

Message-ID: <430ED1C6.10603@insa-toulouse.fr>
Permalink:  ../430ED1C6.10603@insa-toulouse.fr/
Also on:    postgresql.org/message-id/430ED1C6.10603@insa-toulouse.fr

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] After an insert, the trigger can't find the row
  In-Reply-To: <430ED1C6.10603@insa-toulouse.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox