Re: Q: DBMS update framework for use within Apache::DBI?

2000-05-20 Thread w trillich

"Bruce W. Hoylman" wrote:
 
  "Gunther" == Gunther Birznieks [EMAIL PROTECTED] writes:
 Gunther This first criteria seems a tad odd to me. What business
 Gunther scenario is there for this?
 
 The framework is to support an intranet time tracking application.  The
 business rules of the system dictate there are no deletions of
 previously submitted time ... only inserts/updates.  Therefore I can say
 without question that an existing time record will *always* exist (a
 modify), albeit in a potentially 'dirty' state (rule #2).
 
 Furthermore, if a particular time period has not been accounted for,
 i.e. no time record has been previously submitted, a default time
 record will be presented for modification, and subsequent submission (an
 insert).  This is seamless to the client requesting the period.  If
 there is no default time record available, then a 0-hour time record is
 presented for modification/submission (also an insert).

need custom record locking?

how about adding a field such as 'lock' which is set
when a record is requested, so only one user can modify it?
i.e. your script sends a flag to others who've requested a
'lock'ed record. i'd also put a timeout on it so that if a
user quits his browser or gets distracted, his page gets
updated to another location after freeing up the lock...

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Their is five errers in this sentance.



Re: Q: DBMS update framework for use within Apache::DBI?

2000-05-18 Thread Gunther Birznieks

At 12:16 PM 5/17/00 -0600, Bruce W. Hoylman wrote:

Ciao!

I am searching for the makings of a framework built around or within
mod_perl/Apache::DBI that supports the consistent update of a record
within a database.  Primarily I am wanting to ensure read/write
integrity between database accesses by the web client, meaning I wish to
ensure the record about to be updated meets the following criteria:

 1) It exists.  If it does not, perform an insert instead
 2) If it exists, check that it is unchanged from the time the web
client first retrieved it for update.  If it has changed, throw
an exception.  I do not want a "last update wins" situation.

This first criteria seems a tad odd to me. What business scenario is there 
for this?

To me, when a user issues an update they expect that the record exists. In 
a way, if the record does NOT exist, then you are really going against your 
rule #2. That is, if they issue an update and the record no longer exists, 
then that is also a change to the record that someone did (a deletion) and 
you are effectively overriding someone elses deletion.

This is being done in an mod_perl/embperl/Apache::DBI environment.

Suggestions or pointers to additional information would be greatly
appreciated.

Peace.

An application which implements #2 and is accelerated when used with 
mod_perl (Apache::Registry) and Apache::DBI is our latest version of WebDB. 
You may download a copy at http://www.extropia.com/ and click on download 
button at the top upper right)...

If you want to read about it, the docs are located at 
http://www.extropia.com/docs/webdb/. Actually it was all generated using 
Stas Bekman's mod_perl guide generator (except using my pods instead of 
Stas's mod_perl guide pods)

The WebDB will do #2 for you and, in fact, allows configuring the strategy 
of updates... eg you can choose to check all fields for changes, a subset 
of fields for changes, or just "key fields" for changes... similar to the 
PowerBuilder DataWindow model of handling client-server updates. This is 
done through the use of Extropia::DataSource which is a library that 
abstracts this stuff away.

By default, WebDB is distributed to be configured to use 
Extropia::DataSource::File, but you just need to take out the file specific 
stuff from the config and then replace -TYPE = 'File' with -TYPE = "DBI" 
and add -DSNAME = 'dbi:yourdatabase etc..." and you are pretty much off 
and running.

So the caveat is that the app is configured by default to work on any 
CGI/Perl environment. But it has been architected to take advantage of 
mod_perl's benefits (eg Apache::DBI) by just changing config parameters in 
the setup file.

Since all the new extropia apps follow this common architecture, we have 
documented the mod_perl specific tuning issues in the Advanced Chapter of 
the Extropia Apps Guide (a supplement to the WebDB Guide) located at 
http://www.extropia.com/docs/extropia_app/

If you don't like WebDB itself and need to write your own logic, then you 
may want to just use Extropia::DataSource by itself (which implements the 
logic you want as an object but no CGI workflow exists around it). The 
documentation and code for that set is located at 
http://www.extropia.com/ExtropiaObjects/

Hope this helps,
 Gunther

__
Gunther Birznieks ([EMAIL PROTECTED])
Extropia - The Web Technology Company
http://www.extropia.com/




Re: Q: DBMS update framework for use within Apache::DBI?

2000-05-18 Thread Bruce W. Hoylman


 "Gunther" == Gunther Birznieks [EMAIL PROTECTED] writes:

Gunther This first criteria seems a tad odd to me. What business
Gunther scenario is there for this?

Gunther To me, when a user issues an update they expect that the
Gunther record exists. In a way, if the record does NOT exist, then
Gunther you are really going against your rule #2. That is, if they
Gunther issue an update and the record no longer exists, then that
Gunther is also a change to the record that someone did (a
Gunther deletion) and you are effectively overriding someone elses
Gunther deletion.

The framework is to support an intranet time tracking application.  The
business rules of the system dictate there are no deletions of
previously submitted time ... only inserts/updates.  Therefore I can say
without question that an existing time record will *always* exist (a
modify), albeit in a potentially 'dirty' state (rule #2).

Furthermore, if a particular time period has not been accounted for,
i.e. no time record has been previously submitted, a default time
record will be presented for modification, and subsequent submission (an
insert).  This is seamless to the client requesting the period.  If
there is no default time record available, then a 0-hour time record is
presented for modification/submission (also an insert).

Gunther An application which implements #2 and is accelerated when
Gunther used with mod_perl (Apache::Registry) and Apache::DBI is
Gunther our latest version of WebDB.  You may download a copy at
Gunther http://www.extropia.com/ and click on download button at
Gunther the top upper right)...

Thank you for the pointer.  I will *gleefully* investigate its
offerings.

| Hope this helps,
|  Gunther

I'll let you know ...

Peace.



Q: DBMS update framework for use within Apache::DBI?

2000-05-17 Thread Bruce W. Hoylman


Ciao!

I am searching for the makings of a framework built around or within
mod_perl/Apache::DBI that supports the consistent update of a record
within a database.  Primarily I am wanting to ensure read/write
integrity between database accesses by the web client, meaning I wish to
ensure the record about to be updated meets the following criteria:

1) It exists.  If it does not, perform an insert instead
2) If it exists, check that it is unchanged from the time the web
   client first retrieved it for update.  If it has changed, throw
   an exception.  I do not want a "last update wins" situation.

This is being done in an mod_perl/embperl/Apache::DBI environment.

Suggestions or pointers to additional information would be greatly
appreciated.

Peace.