How to create 1 DAL which support multiple databases with proper concurrency control. -
11-22-2006
, 06:02 AM
Hi,
I am relatively new to multiuser databases. I have the following
question, i have looked in the newsgroups and on the internet but
could'nt find an answer.
I want to make one DAL which can interface with multiple database
servers (in every case Oracle, MS SQL Server). I've seen a lot of
websites about how to make a DAL for a specific database, but could'nt
find a solution where I have to write the code once which runs for all
/ multiple database servers? Are there tools / standards which i can
use to write a DAL which can interface with multiple databases?
I thought about using ODBC / JDBC as connection between the DAL and the
specific database. But what i read until now ODBC does not
support/handle concurrent writes. The DAL should handle concurrent
writes on the database correctly without loosing information.
Example:
t1: client A gets customer record 'X' from the DAL
t2: client B gets customer record 'Y' from the DAL
t3: client A modifies the telephone number in the record and writes it
to the DAL.
t4: client B modifies the zip code in the record and write it to the
DAL.
The DAL should be smart enough to tell client B that the record which
he wants to save was modified in between by another client.
I hope someone can tell me how to solve this problem? |