[RDBO] insignificant error/behaviour found

2007-01-11 Thread Jonathan Vanasco

Runnin ModPerl2 w/ Apache Restart + Apache DBI + Postgres, I found this:

if  i change a table columns definition during testing, I'll get  
these errors:

DBD::Pg::st execute failed: ERROR:  prepared statement 
dbdpg_17  
does not exist

and to note, on every change i'll see the prepared statement id go  
up  a bit.


I'm  not sure exactly why its happening, but the general  cause is   
clear.  It also doesn't really matter - its  such an edge case.  i  
didn't bother trying to track down where the cached prepared  
startements are being rewritten , and if its looking for an earlier  
or newer version.

but the simple fix is to stop/start the server ( which takes 2  
seconds, and this would only conceivably happen on a dev machine )

I just wanted to warn other people who might  run into this and start  
scratching their heads trying to figure out what is wrong.


// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] insignificant error/behaviour found

2007-01-11 Thread John Siracusa
On 1/11/07 1:39 PM, Jonathan Vanasco wrote:
 if  i change a table columns definition during testing, I'll get
 these errors:
 
 DBD::Pg::st execute failed: ERROR:  prepared statement dbdpg_17
 does not exist

I  believe this is a DBI/DBD::Pg/libpg issue/reality/feature :)  If you
use DBI's prepare_cache() method and you change the db schema between calls,
the previously-cached version of the cached statement will become invalid.
I think that's what you're seeing.

RDBO uses DBI's prepare_cached() method internally by default.  This
behavior can be controlled per-class using the dbi_prepare_cached() method
on the metadata object:

http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Metadata.pm#db
i_prepare_cached

You can also control it per-call in most object and Manager methods using
the prepare_cached parameter.  Example:

http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object.pm#load

So you can either not use prepare_cached() at all, or turn it off when the
schema changes, and then perhaps back on again afterwards.  Overriding
dbi_prepare_cached() in a custom metadata class and making it smart is one
way to do this without worrying about explicit prepare_cached = ...
parameters to every call.

-John



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] insignificant error/behaviour found

2007-01-11 Thread John Siracusa
On 1/11/07 2:16 PM, Jonathan Vanasco wrote:
 On Jan 11, 2007, at 2:03 PM, John Siracusa wrote:
 I  believe this is a DBI/DBD::Pg/libpg issue/reality/feature :)   If you
 use DBI's prepare_cache() method and you change the db schema  between calls,
 the previously-cached version of the cached statement will become  invalid. I
 think that's what you're seeing.
 
 i thought that at first too--  except the prepared statement id is
 changing -- which suggests to me that its not going for  the
 previous version.

Well, does it go away when you use prepare() instead of prepare_cached().
Does enabling/disabled Pg's server-side prepared statements feature have any
effect?

-John



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] helper function request

2007-01-11 Thread Jonathan Vanasco

first off- i'd be willing to write this one.

i'd like to see something like this for debugging:

$rodbObject-status();

that outputs:

===
This object IS in synch with the last known DB  version  | This  
object IS NOT in synch with the last DB version

fieldname | object_value | db_value
-
a| hi  | undef
===







// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] helper function request

2007-01-11 Thread John Siracusa
On 1/11/07 3:04 PM, Jonathan Vanasco wrote:
 first off- i'd be willing to write this one.

Helpers are pretty wide-open, so don't ask, just write it :)  If it really
is solely for debugging, however, I think a Rose::DB::Object::Debugging
module would a nice.  It'd be the same thing as Helpers (import methods
under optionally customized names) but separated to keep from bloating the
more-useful-in-production Helpers module.

Anyway, throw the code (and docs and tests :) at me and we'll have a start.

-John



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] helper function request

2007-01-11 Thread Jonathan Vanasco

On Jan 11, 2007, at 3:13 PM, John Siracusa wrote:

 Helpers are pretty wide-open, so don't ask, just write it :)  If it  
 really
 is solely for debugging, however, I think a  
 Rose::DB::Object::Debugging
 module would a nice.  It'd be the same thing as Helpers (import  
 methods
 under optionally customized names) but separated to keep from  
 bloating the
 more-useful-in-production Helpers module.

 Anyway, throw the code (and docs and tests :) at me and we'll have  
 a start.

this would be solely for debugging -- so the namespace makes sense.

i'll  craft up a method over the weekend.

i'm going to structure it like this:

Rose::DB::Object::Debugging base 
namespace (empty)
Rose::DB::Object::Debugging::Helpersmixin objects 
for debugging

this way inheritable methods can be cleanly separated out



// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] helper function request

2007-01-11 Thread John Siracusa
On 1/11/07 3:49 PM, Jonathan Vanasco wrote:
 i'm going to structure it like this:
 
 Rose::DB::Object::Debugging base namespace (empty)
 Rose::DB::Object::Debugging::Helpers   mixin objects for debugging

If so, let's go with Debug instead of Debugging.  I picked Debugging
before because I didn't want any confusion with the various $Debug package
variables, but if everything's going to be in ::Debug::*, then that's not an
issue.

-John



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object