Hi,
May be what I say is debatable but let me say this that both EJB Conatainer
and Database coordinate to achieve the integrity. We must specify the
database constraints at the database level(For eg. while creating the
tables).We also set some attributes int the deployment descriptor regarding
transaction based on which container talks to the resource manager and
throws any exceptions if the rule is not followed.

Regards
Ashwani Kalra
E-Comm Group
NIIT Ltd. India


> ----------
> From:         Gero Vermaas[SMTP:[EMAIL PROTECTED]]
> Reply To:     [EMAIL PROTECTED]
> Sent:         Sunday, July 23, 2000 8:41 PM
> To:   [EMAIL PROTECTED]
> Subject:      Use DB constraints with EJB's or not?
>
> Hi,
>
> I had a discussion with a colleque of mine and we did not reach a
> agreement,
> maybe some experts on this mailing list can help us out....
>
> The question is: Should you use database level constraints to enforce the
> integrity of the database or is the integrity of the database the
> responsibility of the EJB?
>
> My collegues opinion is that it is the responsibility of the EJB to
> enforce
> the integrity of the data in the database. If you would implement this in
> constraints in the database then both the EJBs and the database would have
> to know about the integrity rules. Which is duplication of
> knowledge/logic,
> which is not a good thing.
>
> At first I agreed with him, but now I have second thoughts:
> - What if the database is used by other (non J2EE) applications? The
> integrity then must be maintained by the database, or should all
> applications be held responsible for the integrity? The latter would mean
> distributing the reponsibility over multiple applications, which is not a
> good thing? This would advocate to put the responsibility in the database
> and define the constraints there.
> - By putting the constraints in the database you enforce that their is one
> place where the data is consistent. Specific application could add
> additional constraints for that application into their logic, as long as
> it
> does not conflict with the data model.
>
> I'm anxious to hear your opinions on this....
>
> Regards,
>
> Gero Vermaas
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
>
Visit http://www.NetVarsity.com for online learning

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to