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 Q1: How likely? Q2:

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-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

Re: Statement handle side effects of swap_inner_handle?

2006-01-26 Thread Henri Asseily
You may want to check the source of DBIx::HA. I did a lot of that type of work, see below for a sample. Be warned though that I think some of that code could be cleaned up now that we have $h-{ChildHandles}. It's a lifesaver. Also having the upgraded error handler will allow for cleaner code as

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. Patches always welcome of course. You've got

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 deal with CachedKids as well. Simple. Some good news on

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 values).

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 to

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 caller to re-try the failed

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 statement's clone would account for