Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8646289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:46:09+00:00 2026-06-12T12:46:09+00:00

I have a sequence of insert, after insert trigger update, and query operations and

  • 0

I have a sequence of insert, after insert trigger update, and query operations and my problem is that the data received from the query does not reflect the updates performed by the trigger (even though the data in the database is indeed updated).

I’m using PHP, PostgreSQL and Propel 1.6 ORM (although this problem might be database and ORM agnostic).

I have the following sequence:

  1. Use AJAX to insert a new row (a vote) in the “book_vote” table (with columns: ‘book_id’, ‘book_score’, ‘voter_id’).

  2. Have a PostgreSQL after insert trigger to update the corresponding book “vote_count” and “average_score” columns in the “book” table.

  3. Make a query to get the new “vote_count” and “average_score” data for the “book” and send that data back to the client with AJAX (to display updated values after the vote).

This all happens within the same PHP session, and my problem is that I do not get the updated “book” values in the AJAX response. It seems like the query is performed before the database trigger is performed. Is there any way to ensure the query happens after the database trigger?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:46:11+00:00Added an answer on June 12, 2026 at 12:46 pm

    It seems to me that you are doing a save on a Propel object, and you have an external trigger that modifies that row further. You need to be able to tell Propel that the object needs refreshing immediately after the insert/update… and thankfully Propel supports that directly. In your table element in your schema, do this:

    <table name="book_vote" reloadOnInsert="true" reloadOnUpdate="true">
    

    You can use either or both of the reload statements, depending on requirements (in your case you’ll probably just want the insert one). From there, just rebuild your model and it should work fine.More details here.

    Addendum: as per discussion, the issue appears to be that you have already loaded the foreign row that you wish to reload, and as such it is being retrieved from the instance pool rather than the database. You’ve found that BookPeer::clearInstancePool() solved it for you – great! For bonus points, see if you can remove items from the pool individually – it is probably more efficient to allow the pool to run normally and to remove items one at a time, rather than to clear the pool for a whole table. Let us know if this is possible!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem with IE. I have a sequence of forms on
I was wondering if this was possible... I have a sequence of variables that
Background: I have a sequence of contiguous, time-stamped data. The data-sequence has holes in
Folks, I have an MVC3 data entry form scenario that involves asking the user
I've got an user: user_x that owns a database on postgresql and does not
I'm using Oracle database and I have sequence and trigger for generating and storing
I have a sequence which varies in length e.g. something like: items <- 1:4
I have a sequence like [0, 1, 0, 1, 0, 1, 0] and I
I have a sequence of maps. ;; input [{:country MX, :video 12345, :customer cid1}
I have a sequence of k nodes N1 , N2 , N3 , ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.