RE: adding key to DB object

2005-03-29 Thread Ronald J Kimball
Rutherdale, Will [mailto:[EMAIL PROTECTED] wrote: > For the same reason you wouldn't modify data in a C structure belonging to > an API you're using. It violates the general software engineering > principles of information hiding and encapsulation. There are all kinds > of reasons putting your

Re: embedding DB handle in object (was RE: adding key to DB object)

2005-03-29 Thread Brandon Metcalf
T == [EMAIL PROTECTED] writes: T> On Tue, Mar 29, 2005 at 04:58:53PM -0600, Brandon Metcalf wrote: T> > In trying to take your suggesting and embed a DB handle in my own T> > object, this is what i've come up with. However, a error is being T> > thrown when DBI is trying to destory the handle

Re: embedding DB handle in object (was RE: adding key to DB object)

2005-03-29 Thread Tim Bunce
On Tue, Mar 29, 2005 at 04:58:53PM -0600, Brandon Metcalf wrote: > In trying to take your suggesting and embed a DB handle in my own > object, this is what i've come up with. However, a error is being > thrown when DBI is trying to destory the handle which I understand. > What I don't get is how t

embedding DB handle in object (was RE: adding key to DB object)

2005-03-29 Thread Brandon Metcalf
In trying to take your suggesting and embed a DB handle in my own object, this is what i've come up with. However, a error is being thrown when DBI is trying to destory the handle which I understand. What I don't get is how to do this properly. This may be inappropriate for this forum. $ cat j

RE: adding key to DB object

2005-03-29 Thread Brandon Metcalf
W == [EMAIL PROTECTED] writes: W> For the same reason you wouldn't modify data in a C structure belonging W> to W> an API you're using. It violates the general software engineering W> principles of information hiding and encapsulation. There are all kinds W> of W> reasons putting your own

RE: adding key to DB object

2005-03-29 Thread Rutherdale, Will
y 29 March 2005 15:36 To: David Goodman Cc: dbi-users@perl.org Subject: Re: adding key to DB object d == [EMAIL PROTECTED] writes: d> Why do you see using private attributes like d> $dbh->{private_commitflag} as preferable to embedding d> a dbh in your own object? I suppose I co

Re: adding key to DB object

2005-03-29 Thread Brandon Metcalf
d == [EMAIL PROTECTED] writes: d> Why do you see using private attributes like d> $dbh->{private_commitflag} as preferable to embedding d> a dbh in your own object? I suppose I could do that. Why would you use the latter method? -- Brandon

Re: adding key to DB object

2005-03-29 Thread David Goodman
Hello Brandon: Why do you see using private attributes like $dbh->{private_commitflag} as preferable to embedding a dbh in your own object? regards, David --- Tim Bunce <[EMAIL PROTECTED]> wrote: > On Tue, Mar 29, 2005 at 12:20:09PM -0600, Brandon > Metcalf wrote: > > j == [EMAIL PROTECTED] wri

Re: adding key to DB object

2005-03-29 Thread Brandon Metcalf
T == [EMAIL PROTECTED] writes: T> On Tue, Mar 29, 2005 at 12:20:09PM -0600, Brandon Metcalf wrote: T> > j == [EMAIL PROTECTED] writes: T> > T> > j> No, that's wrong. It may look like a hash, but when you set or query T> > j> attributes, you are actually calling the STORE() and FETCH() meth

Re: adding key to DB object

2005-03-29 Thread Tim Bunce
On Tue, Mar 29, 2005 at 12:20:09PM -0600, Brandon Metcalf wrote: > j == [EMAIL PROTECTED] writes: > > j> No, that's wrong. It may look like a hash, but when you set or query > j> attributes, you are actually calling the STORE() and FETCH() methods of > j> the DBD and of DBI. You can only set

Re: adding key to DB object

2005-03-29 Thread Brandon Metcalf
j == [EMAIL PROTECTED] writes: j> No, that's wrong. It may look like a hash, but when you set or query j> attributes, you are actually calling the STORE() and FETCH() methods of j> the DBD and of DBI. You can only set attributes that can be handled by j> the DBD and by DBI, you can't invent

Re: adding key to DB object

2005-03-29 Thread Jeff Zucker
Brandon Metcalf wrote: Can someone explain why I can't do the following: print $dbh; $dbh is a blessed object, printing it or even using Data::Dumper on it will get you no joy. $dbh->{commitflag} = 1; print "commitflag is $dbh->{commitflag}"; $dbh attributes must be either a) upper-c

adding key to DB object

2005-03-29 Thread Brandon Metcalf
Can someone explain why I can't do the following: $ cat uu #!/usr/bin/perl -l use strict; use warnings; use DBI; my $dbname = 'foo'; my $host = 'myhost'; my $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host", '', ''); print $dbh; $dbh->{commitflag} = 1; print "commi