On Feb 27, 10:13 am, Jeremy Evans <[email protected]> wrote:
> On Feb 27, 8:30 am, Jeremy Evans <[email protected]> wrote:
>
> > I'm going to be running the modified patch through the test suite, and
> > assuming no problems, it should be merged later today. I did some
> > light testing with it and found no issues, but as both of the specs
> > use mocked database connections, more real world testing would be
> > great.
>
> I made a few more tweaks and just merged the code into the master
> branch:https://github.com/jeremyevans/sequel/compare/0f73864dcd...ca882f1171
>
> As always, additional testing is appreciated. :)
One thing I've noticed about these two extensions when used in
conjunction, is that you probably want to do:
DB.with_server(:host=>'...', :database=>'...'){DB.synchronize{...}}
Without the synchronize inside the block, each attempt to access the
database inside the block will start a new connection. Anyone using
both the extensions may want to do:
def DB.with_server(*)
super{synchronize{yield}}
end
The issue with doing this in the extensions themselves is that they
are independent and I don't want to couple them. If you are just
using server_block, you probably don't want the synchronize, and if
you are just using arbitrary_servers, with_server may not be defined.
It is possible to conditionally override with_server in
arbitrary_servers if it is already defined, but that brings up
ordering issues and magical behavior that I'd rather not deal with.
I'll add a note to the arbitrary_servers RDoc about this.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.