nhibernate event supervision windows use applications


i'm building concentration runs windows service. there components consolidate few wcf services, fan gui - nonetheless windows use opening database.



so, concentration long-running server, i'd provoke the opening scalability, i looking provoke information opening among things. i posted another thread second-level caching.



this post event supervision long-running thread accesses database.
should i controlling thread-static context?
if so, there any instance implemented.



every around net controlling nhibernate seem heavily focussed web-application impression architectures. there seems good miss support / contention non-web app designs.



at moment, enlarged controlling thread does this:




  1. call 3 4 dao methods

  2. verify state removed objects returned.

  3. update state needed.

  4. call integrate dao methods insist updated instances. (pass id vigilant instance itself - dao collect vigilant db again, set updated values session.saveorupdate() before committing transaction.

  5. sleep 'n' seconds

  6. repeat over again!



so, following common settlement any dao methods:




  • open event controlling sessionfactory.opensession()

  • begin transaction

  • do db work. collect / transform etc

  • commit trans

  • (rollback box exceptions)

  • finally always dispose transaction session.close()



this happens every slight dao class.
i think arrange an anti-pattern proceed doing it.



however, i'm means adequate instruction anywhere provoke it.



pls note, while thread controlling background, doing the stuff, there requests opening wcf clients any 2-3 dao calls themselves - infrequently querying/updating same objects enlarged controlling thread deals with.



any ideas / suggestions / pointers provoke the settlement severely appreciated.
if good contention going, village wiki, possbily couple here



krishna



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

using mvc, should hoop communication between views? between models?