Re: create() 'v' the docs

[prev] [thread] [next] [Date index for 2005/07/07]

From: Tony Bowden
Subject: Re: create() 'v' the docs
Date: 13:18 on 07 Jul 2005
> 	my $obj = Class->create(\%data);
> This is a constructor to create a new object and store it in the database.
> -----><8-----
> It seems to me 'create a new object' is true and 'store it in the database' is
> false, in that with {AutoCommit = 0} the default under Postgres, then the store
> simply does not take place.

I would disagree. Even with AutoCommit off, the storing in the database
does happen. It's just isolated until you commit it or roll it back.

> o The concept of autoupdate is presented in 3 different ways:
> 	- sub autoupdate(N), ie code
> 	- Database handle attribute {AutoCommit => N} ie code
> 	- Transactions turned on, ie English

You appear to be conflating autoupdate and autocommit. These are two
completely different things.

> (b) To a database guru the meaning of 'update() merely issues the UPDATE to the
> database' is clear, but to a beginner, no. Far from it.

I don't expect Class::DBI users to necessarily be database gurus. But
it is important to have at least a basic knowledge of SQL and how
databases work.

The SQL "UPDATE" statement is far from advanced.

> What's lacking in the docs (for the benefit of beginners) is the point of having
> an update() sub which doesn't update the way a beginner would expect...:-).
> Right?

I disagree. Update does exactly what most people expect - it issues an
UPDATE command. 

Your confusion seems stems from not knowing how transactions work,
which is a completely different issue.

Tony

create() 'v' the docs
Ron Savage 12:18 on 07 Jul 2005

Re: create() 'v' the docs
Tony Bowden 13:18 on 07 Jul 2005

Generated at 16:36 on 28 Jul 2005 by mariachi v0.52