This is a migrated thread and some comments may be shown as answers.

WCF Integration

4 Answers 87 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
bin
Top achievements
Rank 1
bin asked on 27 Apr 2011, 10:33 AM

Hi Sir,

 

I have two questions :

 

1- I am using telerik open access object scope to access a mssql database 2008.
I have a case in which i select a result set of data and make some modification and then update it to the database again in side a single transaction , during this operation i do  not want any user to access this result set (update or read) , so how can i do that ?

2- I have developed a component (DAL) contains generic methods that uses telerik open access object scope to access more than one database depending on the connection string passed to it , then for each database i created a component (dbnameEntity) that contains the persistent classes for that database, then i created a business layer component (BL) that apply my business  and calls the methods in the DAL passing the connection string to it depending on which dbnameEntity it deals with , after that i call the BL methods from my user interface application (UI) , until now everything is ok and successful.
My manager asked me to add a WCF layer between the BL layer and the UI layer , WCF do not know the persistent classes or open access , how can i do that and in the same time keep my layers structure.

Thanks

4 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 29 Apr 2011, 02:42 PM
Hi bin,

Pessimistic concurrency control can be achieved by setting an appropriate transaction isolation level in the OpenAccess' backend configuration. You can find more information how to do that and what are the available options in this article. More details about the different behaviors can be found here as well.

Regarding the WCF service, it would be best if you implement some kind of transport objects and do not use the persistent classes directly. As you mentioned, this is actually one of the requirements. Unfortunately, as you are using the "classic" API (not the DSL designer) you will have to write those classes manually and take care of the translation between them and the persistent classes. We provide a code generation template which can generate such transport object based on a domain model but it will not work with a model generated with the Reverse Mapping wizard. I hope this gives you the initial idea, please let us know if you need more details.

Greetings,
Alexander
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
bin
Top achievements
Rank 1
answered on 29 Apr 2011, 04:13 PM
Hi Sir,

1- According to the links you provided me , I think that in my case i should  set the isolationLevel in the application configuration file  to be SERIALIZABLE . the question is : 
is this configuration will be applied to all the transactions used in my application  or for only the transaction that deals with my resultset case ???
Of course , I want it to be applied for only the transaction that  deals with my resultset case .
I am waiting your answer.

2- I will be very thankful if you send me more details and  a sample that can be applied to my case and suitable to my layers structure.

Thanks

0
bin
Top achievements
Rank 1
answered on 02 May 2011, 09:23 AM
Hi Sir,

Any response please ???

Thanks
0
Alexander
Telerik team
answered on 05 May 2011, 02:56 PM
Hello bin,

Yes, the Serializable isolation level should work for you. However, if you specify this option in the backend configuration of the App.config, it will be used for all transactions made with this model. If you want to apply a lock only for particular transaction, you will have to use the Lock method, described at the end of the first article I mentioned.

Regarding the WCF service and the implementation of proxy classes, you can have a look at our Northwind WCF demo, and more particularly the NSV.NW.OABLL project where the translation between the persistent classes and the WCF data contract classes is done. I hope that helps.

Greetings,
Alexander
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Tags
Development (API, general questions)
Asked by
bin
Top achievements
Rank 1
Answers by
Alexander
Telerik team
bin
Top achievements
Rank 1
Share this question
or