Skip to content

[WIP] Transactions#93

Merged
usmanhalalit merged 1 commit intousmanhalalit:masterfrom
acburdine:transactions
Oct 19, 2015
Merged

[WIP] Transactions#93
usmanhalalit merged 1 commit intousmanhalalit:masterfrom
acburdine:transactions

Conversation

@acburdine
Copy link
Copy Markdown
Contributor

Refs #17

This is a work-in-progress on adding transactions support to the query builder

Tasks:

  • Add initial transaction code
  • Add tests
  • Update readme

@acburdine
Copy link
Copy Markdown
Contributor Author

@usmanhalalit the older travis build got stuck for some reason, would you mind stopping it?

@Mrhyuan
Copy link
Copy Markdown

Mrhyuan commented Oct 12, 2015

it's better to support return false value to rollback the transactions

@acburdine
Copy link
Copy Markdown
Contributor Author

@Mrhyuan isn't the point of transactions to roll them back if there's a failure?

usmanhalalit pushed a commit that referenced this pull request Oct 19, 2015
@usmanhalalit usmanhalalit merged commit 8f67f46 into usmanhalalit:master Oct 19, 2015
@matthijsthoolen
Copy link
Copy Markdown

Any updates on the transactions, or a way I can use this on the master branch?

@acburdine
Copy link
Copy Markdown
Contributor Author

@Eragon666 In theory transactions should work (I didn't test them before this was merged 😕 ). If you want to use them just require 'dev-master' in your composer.json file like so:

{
    "require": {
       "usmanhalalit/pixie" : "dev-master"
    }
}

@matthijsthoolen
Copy link
Copy Markdown

Thank you for the response.

I checked the code for the transactions but it wasn't clear to me how to use it with Pixie.

Can we also manually rollback a transaction, or is it only possible to rollback when PDO gives an exception?

So for example: I add a new record (lets call it A) to the table, in another query I add items who depend on record A. But if for some reason no records are added (I check for duplicate keys), I want to rollback the changes for record A.

How can I do that? Or isn't that possible yet with your transaction code?

@acburdine
Copy link
Copy Markdown
Contributor Author

@Eragon666 those are good ideas 😄 I didn't get a chance to fully implement this but I'll see what I can do today.

@matthijsthoolen
Copy link
Copy Markdown

@acburdine Please keep me updated :) If you don't have the time now, I can also take a closer look to this and see if I can implement it myself.

Also if you need any help, let me know!

@matthijsthoolen
Copy link
Copy Markdown

@acburdine Hi! Any updates on the transactions?

@acburdine
Copy link
Copy Markdown
Contributor Author

@Eragon666 sorry the last month or so got crazy with classes and such => should have some time to work on it tomorrow/this weekend. I'll let you know if I don't though.

@acburdine
Copy link
Copy Markdown
Contributor Author

@Eragon666 see #102

@matthijsthoolen
Copy link
Copy Markdown

@acburdine really nice. I will try it later this week! Thanks for your time!

@acburdine acburdine deleted the transactions branch September 26, 2024 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants