-
Notifications
You must be signed in to change notification settings - Fork 15
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
transaction as subroutine appears to be unworkable in my case #24
Comments
I wouldn't turn down a patch that offered a lightweight implementation of such a thing. I don't think it would need to be very complicated. I'd like to see what it looked like, though. |
well my thought would be just to use DBI's functionality, but glancing over your code you are using the underlying DBD's directly and I'm not sure why. Why is DBI's own transaction interface insufficient? the more I'm looking over it, I'm thinking the simple solution of exposing DBI's methods would work.
|
FWIW, setting But to answer your question, the direct hash stuff is used so that things can be |
they may have been added later but they're still useful, the thing is I'll have to turn autocommit off and manually handle the transactions. I think begin_work may be optional, but it seems like a good idea to use. |
It is but sometimes it's not the right choice. If you were to switch DBIx::Connector over to them, I'm pretty sure the tests will fail. The ability to use |
I'm getting the feeling that allowing an interface that allows me to have an interface similar to |
It can be done. DBIc implements |
out of curiousity? because I've never really turned autocommit off... but it appears by DBI's doc if it's off you have to call |
Like this -- yes, using |
I'm trying to write a Unit of Work object http://martinfowler.com/eaaCatalog/unitOfWork.html with DBIx::Connector as the underlying connector, unfortunately as I look at it I'm unable to resolve any way that I can use Connectors transaction support using this pattern.
The reason for this is that my begin needs to start in a different method from commit, and the only way I have seen to resolve this is to move it to a higher level, but I don't like that because that puts database specific code at a layer higher than I want.
would you add something like DBIC's txn guard? expose support for DBI's native transaction support? or maybe add callbacks that are more like AnyEvent::DBI's (considering switching to that)
The text was updated successfully, but these errors were encountered: