SQL Dependancy

Posts   
 
    
MRamesh
User
Posts: 8
Joined: 01-Apr-2006
# Posted on: 01-Apr-2006 13:20:51   

SQL Server 2005 and ADO.Net has released the dependancy class for data concurrency verification. How do we achieve this in LLBLGenPro?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 01-Apr-2006 14:24:45   

And what class might that be? It would be nice if you would be a tiny bit more specific simple_smile .

Frans Bouma | Lead developer LLBLGen Pro
MRamesh
User
Posts: 8
Joined: 01-Apr-2006
# Posted on: 01-Apr-2006 15:10:33   

The new class called SqlDependency is available in ADO.Net 2 and it is supported only in SQL server 2005.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 04-Apr-2006 09:45:33   

MRamesh wrote:

The new class called SqlDependency is available in ADO.Net 2 and it is supported only in SQL server 2005.

Aha. simple_smile Ok, you can use this today. At least in adapter you can. In for example the OnFetchEntityCollection() method (there are others for other actions as well) of the DataAccessAdapter class you can obtain the actual query and the IDbCommand object. Create a subclass of DataAccessadapter and override OnFetchEntityCollection() and obtain the command by consulting the passed in query object which contains the command, then create your SqlDependency object of it.

Frans Bouma | Lead developer LLBLGen Pro
MRamesh
User
Posts: 8
Joined: 01-Apr-2006
# Posted on: 08-Apr-2006 08:02:40   

Thanks for your update. How can I do it in selfservicing Sql server component?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 08-Apr-2006 11:38:32   

MRamesh wrote:

Thanks for your update. How can I do it in selfservicing Sql server component?

That's a little tricky, though it's possible. (not tested, but it should work). Derive a class from the entitycollection class you need dependency for, like CustomerCollection. Derive a class from the DAO class of the entity of the entitycollection class, here CustomerDAO. Override CreateDAOInstance in CustomerCollection to create an instance of your derived customerdao instance. in CustomerDAO override ExecuteMultiRowRetrievalQuery and create your SqlDependency there from the Command in the passed in IRetrievalQuery. Then pass everything on to the base method.

Frans Bouma | Lead developer LLBLGen Pro