Watch, Follow, &
Connect with Us
Public Report
Report From:    [ Add a report in this area ]  
Report #:  37147   Status: Closed
Check Constraints in TEcoPersistenceMapperProvider
Project:   Build #:  10.0.2288.42451
Version:    10.0 Submitted By:   Mathias Burbach
Report Type:  Suggestion / Enhancement Request Date Reported:  11/29/2006 3:55:03 PM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   243316
Resolution: As Designed (Resolution Comments) Resolved in Build: :
Duplicate of:  None
Voting and Rating
Overall Rating: (6 Total Ratings)
4.50 out of 5
Total Votes: 15
Description
I have tried to build a multi-tier ECO app and tried to enforce constraints on the ECO .Net Remoting Server. That failed because the TEcoPersistenceMapperProvider.PersistenceMapper property doesn't allow to assign a descendent of ChainedPersistenceMapperBase because the property is of type PersistenceMapperDb but ChainedPersistenceMapperBase is only of type PersistenceMapper.

In general it would be really good if ECO were to offer some easy methods on the .Net Remoting Server side to inspect the datablock (or Delta) and check for invalid constraints. A bit like the BeforeApplyUpdates & BeforeUpdateRecord events of a TDataSetProvider.
Steps to Reproduce:
The attached example app shows how a TAccount class could check its constraint "BalanceWithinLimit" (self.Balance >= self.CreditLimit) on the client side and the server side.

To reconstruct the problem uncomment the code in TEcoPersistenceMapperProvider.Create and the server project will no longer compile.

You will need an InterBase/Firebird alias called Accounts on localhost and generate the schema with the help of the TEcoPersistenceMapperProvider.
Workarounds
None
Attachment
Multi-Tier.zip
Comments

None

Server Response from: ETNACODE01