Re: swap_inner_handle

2006-10-06 Thread Henri Asseily
On Oct 5, 2006, at 4:39 PM, Tim Bunce wrote: Let's try this and see how it works out: Original state: dbh1o -> dbh1i sthAo -> sthAi(dbh1i) dbh2o -> dbh2i swap_inner_handle dbh1o with dbh2o: dbh2o -> dbh1i sthAo -> sthAi(dbh1i)

Re: swap_inner_handle

2006-10-06 Thread Vladimir Pozek
sthAo -> sthAi(dbh1i) dbh2o -> dbh2i swap_inner_handle dbh1o with dbh2o: dbh2o -> dbh1i sthAo -> sthAi(dbh1i) dbh1o -> dbh2i create new sth from dbh1o: dbh2o -> dbh1i sthAo -> sthAi(dbh1i) dbh1o -> dbh2i sthBo

Re: swap_inner_handle

2006-10-05 Thread Tim Bunce
s happening.] > > My thoughts exactly :) Let's try this and see how it works out: Original state: dbh1o -> dbh1i sthAo -> sthAi(dbh1i) dbh2o -> dbh2i swap_inner_handle dbh1o with dbh2o: dbh2o -> dbh1i sthAo -> sthAi(dbh1i)

Re: swap_inner_handle

2006-10-05 Thread Henri Asseily
On Oct 5, 2006, at 6:19 AM, Tim Bunce wrote: On Wed, Oct 04, 2006 at 11:53:48AM -0700, Henri Asseily wrote: I have an issue with proper usage of swap_inner_handle: Say I have a dbh with an active sth. I create a new dbh (new_dbh) and swap its inner handle with dbh. Now is sth a child of dbh

Re: swap_inner_handle

2006-10-05 Thread Tim Bunce
On Wed, Oct 04, 2006 at 11:53:48AM -0700, Henri Asseily wrote: > I have an issue with proper usage of swap_inner_handle: > > Say I have a dbh with an active sth. > I create a new dbh (new_dbh) and swap its inner handle with dbh. > > Now is sth a child of dbh or new_dbh? i.e.

swap_inner_handle

2006-10-04 Thread Henri Asseily
I have an issue with proper usage of swap_inner_handle: Say I have a dbh with an active sth. I create a new dbh (new_dbh) and swap its inner handle with dbh. Now is sth a child of dbh or new_dbh? i.e., is sth linked to the inner dbh, or not at all? Then I create a new sth (new_sth) and swap

Re: Statement handle side effects of swap_inner_handle?

2006-01-30 Thread Tim Bunce
On Fri, Jan 27, 2006 at 07:12:12PM -0500, Steven Lembark wrote: > > >>> Umm, bind_columns is probably do-able if the DBI gave you a way to > >>> access the current row array. Then you could just bind the new columns > >>> to the old ones. > >> > >>Any real odds? > > > >Odds? > > "Probably do-able

Re: Statement handle side effects of swap_inner_handle?

2006-01-27 Thread Steven Lembark
Artistic Opinion: Would reconnecting the damaged handle and keep it usable with an appropriate error then loosing the transaction (and letting the caller deal with it as an exception) seem reasonable? Yes. That would possibly suffice is all code gets its statement handles via prepare_cached().

Re: Statement handle side effects of swap_inner_handle?

2006-01-27 Thread Steven Lembark
> Umm, bind_columns is probably do-able if the DBI gave you a way to > access the current row array. Then you could just bind the new columns > to the old ones. Any real odds? Odds? "Probably do-able" Q1: How likely? Q2: Any timeframe? -- Steven Lembark

Re: Statement handle side effects of swap_inner_handle?

2006-01-26 Thread Tim Bunce
On Thu, Jan 26, 2006 at 02:33:21PM -0500, Steven Lembark wrote: > > >> The only thing this doesn't pull across that I can think > >> of is the current row state of each handle > > > > You could use $sth->rows and fetch to the same row count > > (but there's no guarantee you'll be getting the same

Re: Statement handle side effects of swap_inner_handle?

2006-01-26 Thread Steven Lembark
>> Q: If the cached kids are stored in $new_dbh, wouldn't I >>overwrite the statement handles when I performed the >>$old_dbh->swap_inner_handle( $new_dbh )? > > True. If you swap_inner_handle for all ChildHandles then you'll > automatically dea

Re: Statement handle side effects of swap_inner_handle?

2006-01-26 Thread Tim Bunce
On Thu, Jan 26, 2006 at 02:04:28AM -0500, Steven Lembark wrote: > > > The inner handle carries all the DBI info, including CachedKids. > > So swap_inner_handle is a simple and total brain transplant. > > Q: Any chance of getting "$sth->clone"? Doubtful. Patche

Re: Statement handle side effects of swap_inner_handle?

2006-01-26 Thread Henri Asseily
# the reconnect worked, so the database is fine. # get rid of the old database handle warn "$prefix *** TIMEOUT! server busy: $sql ; dsn: $dsn \n" if (DBIx_HA_DEBUG); $dbh->swap_inner_handle($n

Re: Statement handle side effects of swap_inner_handle?

2006-01-25 Thread Steven Lembark
> The inner handle carries all the DBI info, including CachedKids. > So swap_inner_handle is a simple and total brain transplant. Q: Any chance of getting "$sth->clone"? >From what I can see in the doc's, the clone method is specific to database handles (the statemen

Re: Statement handle side effects of swap_inner_handle?

2006-01-25 Thread Tim Bunce
On Wed, Jan 25, 2006 at 02:42:18PM -0500, Steven Lembark wrote: > > I'm using swap_inner_handle in a HandleError sub to re-connect > the existing database handle. The trick is to re-connect if > the error warrants it, return false to the caller, which then > allows the

Statement handle side effects of swap_inner_handle?

2006-01-25 Thread Steven Lembark
I'm using swap_inner_handle in a HandleError sub to re-connect the existing database handle. The trick is to re-connect if the error warrants it, return false to the caller, which then allows the caller to re-try the failed operation and keep going. Q: Do I need to use $if_active = 3