Skip to content
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

rollback a transaction left object in a valid state #90

Closed
kumy opened this issue Aug 28, 2019 · 3 comments
Closed

rollback a transaction left object in a valid state #90

kumy opened this issue Aug 28, 2019 · 3 comments

Comments

@kumy
Copy link
Contributor

kumy commented Aug 28, 2019

When we rollback a transaction, the previously saved objects stay in a valid state (valid per use of dry()/valid() functions).

I would have expected the dry() function to return true.

here is a little example:

$f3->get('DB')->begin();
$move = new Move();
$move->comment = 'Some comment';

var_dump(move->dry());
$move->save();
var_dump(move->dry());

$f3->get('DB')->rollback();
var_dump(move->dry());

This outputs:

bool(true)
bool(false)
bool(false)

But I expect it to return:

bool(true)
bool(false)
bool(true)
@ikkez
Copy link
Owner

ikkez commented Aug 29, 2019

Well the mappers don't know when a transaction has started or rolled back and also if, it would be difficult to know to what state to return. If that's a feature request, it would rather go to fatfree-core instead.. but I also have no idea yet how an implementation could look like 🤔

@kumy
Copy link
Contributor Author

kumy commented Aug 29, 2019

Do you have a way to move the issue there, or should I create it from scratch?

@ikkez
Copy link
Owner

ikkez commented Aug 29, 2019

I cannot move the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants