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 7069519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:27:19+00:00 2026-05-28T05:27:19+00:00

Here is an example of my tables <table name=user> <column name=name type=varchar size=255 required=true

  • 0

Here is an example of my tables

<table name="user">
  <column name="name" type="varchar" size="255" required="true" />
</table>

<table name="environment">
  <column name="user_id" type="integer" size="11" required="true" />
  <column name="insertion_time" type="timestamp" required="true" phpName="InsertionTime" />

  <foreign-key foreignTable="user" phpName="User">
    <reference local="user_id" foreign="id"/>
  </foreign-key>
</table>

I want to insert some environment linked with their user.

function insertEnvironment($id) {
    $user = findUser($id);

    $env = new Environment();
    $env->setUser($user);
    $env->setInsertionTime(new DateTime());

    $env->save();
}

function findUser($id) {
    $user = UserQuery::create()->filterByUserId($id)->findOneOrCreate();
    return $user;
}

I can insert more than one environment on the same page but I don’t want to recreate the user if it already exists.

Right now, it creates one user each time I insert an environment (during the same page execution, afterwards it works as expected).

How can I force the insertion of the user so that the next time I want to access it it already exists?

Is there another way to achieve this without forcing a “flush” ?
I don’t want to keep track of the users by hand.

Edit: I changed the way I create the user (code above edited), but it does not help.

  • 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-05-28T05:27:20+00:00Added an answer on May 28, 2026 at 5:27 am

    I found a workaround, which is to disable the pooling.

    Propel::disableInstancePooling();
    

    To add in the setup.php file.
    But it then disable the feature completely, which drains performances down.

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

Sidebar

Related Questions

Here's a pseudo-table: Table: people name : varchar is_married : varchar I have a
Here is an example of what I've got going on: CREATE TABLE Parent (id
Just using this as an example... Here are the columns in my UserProfile table:
I have (again) this tables: User: id | name ------------- 1 | 'John' 2
For example, I have a table which looks like this : id | name
Table User contains the fields id, name, fruit, veggies, meat. Table FruitType contains the
I have three tables, 1-Users, 2-Softwares, 3-UserSoftwares. if suppose, Users table having 6 user
I have 3 tables. user id firstname lastname ... user_rel_domain user_id domain_id value domain
The fictional example here. Suppose I designed a class named IODevice. This class already
I found a great C++/ODBC example here ... The project I downloaded builds great

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.