Freeside 1.1.0
Ivan Kohler
ivan at pouncequick.sisd.com
Wed Apr 8 13:57:24 PDT 1998
-----BEGIN PGP SIGNED MESSAGE-----
On Wed, 8 Apr 1998, News Subsystem wrote:
> Ivan,
> How goes the battle. Were you able to use my patches for Pg6.3,
> and the style changes?
I haven't merged them in with my version yet, but I looked them over and
will probably use everything. Thanks!
> Also, would it be a worthwhile change (in the
> PG6.3 version) to get rid of CounterFile.pm? Pg6.3 has sequence number
> tables which can do exactly what the CounterFile.pm does, but it is all
> in the server. In addition, it allows the following:
>
> insert into cust_pkg (pkgnum, ..) values (nextval('cust_pkg_seqno'), ..) ;
>
> which allocates a unique pkgnum as it is inserted into cust_pkg. This
> gives a more atomic operation than you currently have, where you get a
> number, do some data integrity checks and then add the new record.
Mysql has similar functionality, but it (also) isn't portable. That's
why I used File::CounterFile in the first place. From FS::Record.pm:
# since AUTO_INCREMENT is MySQL specific, use my own unique number generator
# (again)
# ivan at sisd.com 97-dec-4
If we can do this in a portable (across RDBMS's) way, I think it is worth
doing. But I'd like to avoid RDBMS-specific stuff unless we provide a
generic alternative (in this case, it would be File::CounterFile) and wrap
it up so it takes care of itself - see the Mysql-specific bits in
./fs-setup for an example:
if ( datasrc =~ /mysql/ ) { #yucky mysql hack
push @columns, map "UNIQUE ($_)", @{$tables{$table}{'unique'}};
push @columns, map "INDEX ($_)" , @{$tables{$table}{'index'}};
}
Also note that is is absolutely essential to stuff the unqiue number we
just inserted into the database back into the FS::Record object (when you
pre-generate the unique numbers obviously this is a non-problem). IIRC
Mysql's facility for doing that was also non-portable.
- --
Ivan Kohler <ivan at sisd.com> - finger for PGP key
Silicon Interactive Software Design - http://www.sisd.com/
"I want to go on a mountain-top / with a radio and good batteries
play a joyous tune / and free the whole human race from suffering" -Bjork
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv
iQCVAwUBNSvktL7OPBeQJv09AQGVqAQAhjYRHgWmWznp0AZfI6P80VpmeP5eOpzR
A35MdqbOWkyXWq2coPODNpQ9DklCjThl2CcRfSXEGvs/GtDn1HhtOSgkoi6hh1GE
STSagLVPbT48D/Y3Lt1FQUNbhzpR7XGMp7V1wtMFcc+oQFRUXWxtmKDYUVbE+PER
Na9lgoqIX58=
=JE5z
-----END PGP SIGNATURE-----
More information about the freeside-users
mailing list