This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi,
I have a windows application where a single shared connection must be use. I want to use LightSpeed as DataAccessLayer but for the majority of the time, a single connection can be use. As I understand, when I create a UnitOfWork, this create a Connection to the database for querying. The problem is that I use LightSpeed to make some queries and my own old DataAccessLayer and with LightSpeed, I create a single UnitOfWork (I know that is the the best practice) when I start the application and I use it for all the life of the application. If I create a query with LightSpeed on a table and after that I modify the data in the database with my own DataAccessLayer (that don't use the same connection) and finally that I try to query again with LightSpeed the same data, it seem that the data was not extract from the database but extract from the cache.
I wonder if there is a mannered to disabled the cache or if I must create a UnitOfWork each time I query the database with LightSpeed or any other solution for always having the update to date data from the database.
Thank you in advance. |
|
|
No, at the moment you must use a separate unit of work if you want to force a reload. The unit of work will always look in its identity map first. We generally recommend using short-lived units of work for this reason, though it isn't always easy to find good UOW boundaries in a rich client (WinForms or WPF) application. |
|
|
Thank you very much Ivan. Again, you gives me the best answers over all third party that we have at my job.
I think I will review my strategy when using a single connection and I will instead use a pattern that will control the life of my UnitOfWork. |
|