Inconsistency between windows by NHibernate.
I am writing a library management system for church. This is using Spring.Net and NHibnerante. But I faced a problem. After the user updated in a record window, the record in the main window did not get updated. I have read Spring.net Tutorial. That is nothings wrong. Even I forced the session flush. But that did not work. In the session of the record edit window, the fields are updated. When I jumped back to Main Window, the session is updated. Finally, I found the problem in the Transaction attribute. In the DAO, the code should be written like this:
Code
[Transaction(ReadOnly = true)] | |
public IList<TEntity> GetAll() | |
{ |
And the update method
Code
[Transaction] | |
public void Save(TEntity entity) | |
{ |
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 4 feedbacks awaiting moderation...
Form is loading...