Incorporate Notification Services

Posts   
 
    
jbliss1234
User
Posts: 42
Joined: 04-May-2007
# Posted on: 26-Feb-2008 20:02:04   

Since both Oracle and SQl server now have database change notification services, is there any way we can leverage Database Change Notification alongside LLBLGen? Is there any plan to support this in the product?

BTW, I am looking at the source code of the Runtime libraries and I would appreciate some help in figuring out where exactly to incorporate the code related to Oracle Database Change Notification. For Select statements, I would like to do something like:

if data not present in cache { OracleCommand cmd = new OracleCommand(sql, con);

OracleDependency dep = new OracleDependency(cmd);

dep.OnChange += new OnChangeEventHandler(OnDatabaseNotification);

cmd.ExecuteNonQuery();

Store data in cache (using a hash of the commandtext + parameters) } else { get data from cache }

public static void OnDatabaseNotification(object src, OracleNotificationEventArgs args) { invalidate the cache }

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39905
Joined: 17-Aug-2003
# Posted on: 27-Feb-2008 10:07:55   

Isn't the main problem with this that you have to keep open the connection to get notifications ?

With caches, how are you going to check whether something is in the cache? If your query fetches all customers with an order in 2007, you have to go to the db to get the customers matching the query. Or fetch the ID's, check the id's with the cache, and use a range predicate to fetch the rest, though in prefetch paths this gets complicated.

Frans Bouma | Lead developer LLBLGen Pro