-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Active Record Optimistic locking does not work with multiple models #16889
Comments
I have the same problem when I use yii2-relation-trait (mootensai/yii2-relation-trait#60) :-( any help? |
@strtob Laravel... JK. Honestly, I had no luck fixing this |
Thank you for your efforts, that's really a shame. This is a basic functionality (save realted records after a first validation error) and without fixing this in near future, I'll need to rewrite my project with laravel or some other php framework... :-( |
@strtob I think in one of my projects I "fixed" this doing the following: just disable optimistic lock behavior before you save model, then do This is an issue for loading multiple models. Working with a single model is working fine |
@strtob changing to Laravel Will bring you more problema,i'm using it in my job and i don't recomendet..read and seek for a solution instead of just surrender |
Guys, I'm dabbling in comedy so Laravel was a joke. I don't understand why would anyone jump from Yii2 to any other PHP framework. |
We need to summon the great @samdark |
...thanks to share your experience with laravel. In general I'm happy with yii2, but when the app will throw the error furthermore, a normal use can't handle this :-( I will try the |
I hope you can solve your problem, your comment about the comedy made me
laught because it felt relieve about another developer not using laravel. I
never had the issue you are having but i had others and always managed to
solve then, honestly everything i had worked brings challenges, from PHP to
C# to Android there is always stuff like this, for me the most important is
to have a well implemented framework that's why i'm a Yii fanatic..yes i
admit this...i'm a fanatic...
i'm happy you wont use Laravel ;)
El lun., 8 abr. 2019 a las 10:15, strtob (<[email protected]>)
escribió:
… ...thanks to share your experience with laravel. In general I'm happy with
yii2, but when the app will throw the error furthermore, a normal use can't
handle this :-( I will try the $this->updateCounters(...) and hope this
will fix the problem
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#16889 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AcijSNQayckY7dxe8c6wM4C5W1DEhOWcks5ve10IgaJpZM4YePGY>
.
|
Yii2 till I die! Really, I'm working on a big project of my own right now, and if it won't be successful then I'm gonna kill myself |
what are you up to if i may ask?, i have 2 proyects going on right now with
Yii2, and i'm advancing without much trouble...what is this that is so
important to you..i'm just curious cuz it looks like a very big deal to you
El lun., 8 abr. 2019 a las 13:39, WEBKADABRA (<[email protected]>)
escribió:
… Yii2 till I die! Really, I'm working on a big project of my own right now,
and if it won't be successful then I'm gonna kill myself
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#16889 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AcijSGFcGdXO0kPoKcU3b4fp90xacLFTks5ve4zygaJpZM4YePGY>
.
|
@isan26 I'm super broke and spending my time developing a SaaS solution for Ukrainian market. It is very counter-intuitive to do anything for Ukrainian market |
why is that?...ukrainians are from planet earth too..
El lun., 8 abr. 2019 a las 14:58, WEBKADABRA (<[email protected]>)
escribió:
… @isan26 <https://github.com/Isan26> I'm super broke and spending my time
developing a SaaS solution for Ukrainian market. It is very
counter-intuitive to do anything for Ukrainian market
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16889 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AcijSMfCwde7S2js8EUj26OWO_YhlIzcks5ve59vgaJpZM4YePGY>
.
|
You'd think.... 😆 |
if i can help you let me know...maybe a fresh eyes can give you ideas and i
can use your opinion about something i'm building
El lun., 8 abr. 2019 a las 15:48, WEBKADABRA (<[email protected]>)
escribió:
… You'd think.... 😆
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16889 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AcijSDTzNEgFElDmme4LIBDd3qpmsTJGks5ve6sqgaJpZM4YePGY>
.
|
@isan26 if you have some job that pays doing whatever yii2, I'd love to join. |
@Webkadabra tried debugging it? Any idea why it happens? Does actual table schema/model code matters? Could it be reproduced with data-less model with only a few fields and Gii-generated code? What's DB engine? |
this is a solution (shorten) I use in my controller, maybe this will help someone. In first case of conflict, the user will get a message that the next update will overwrite the newest request:
|
What steps will reproduce the problem?
Controller code:
Controller gets POST input:
What is the expected result?
All items should be updated correctly given they are not outdated
What do you get instead?
yii\db\StaleObjectException: The object being updated is outdated. in
Copy Stacktrace Search Stackoverflow Search Google Exception
Stale Object Exception – yii\db\StaleObjectException
The object being updated is outdated.
Additional info
The text was updated successfully, but these errors were encountered: