[Dbix-class] Clone DBIx::Class::Row object to new connection

Rob Kinyon rob.kinyon at gmail.com
Wed Jun 2 12:47:15 GMT 2010


On Wed, Jun 2, 2010 at 08:01, Gerhard Heift
<ml-dbix-class-20090107-b968 at gheift.de> wrote:
>> As for concurrent transactions ... that's what forking is for.
>
> Currently I write a GUI based on DBIx::Class in only one process (no threads,
> no forks). I have windows to edit rows in the database. I use rowbased locking
> and for this I like to have separate connections for each window. For this I
> think I need the database cloning.

You do understand that since all of your connections are going to be
in one process, you still don't have concurrent processing. Just
because different window objects have different connections, they're
still going to be processed one at a time. The only ways to get
concurrency are forking or threading. As threading generally sucks (in
general for many reasons and specifically in Perl), best to use
forking.

This is very much a design smell. I would urge you to rethink. If not,
then I would reconnect in each window object and re-find the specific
row. Don't do any fancy cloning.

Rob



More information about the DBIx-Class mailing list