Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - Simplest way of using Hibernate Sessions -


i'm coaching student project uses hibernate persistence layer. projects @ work i'm quite familiar hibernate , can use few 'troubles'. project have problem sessions, stale objects , and 'object loaded different session'-errors.

so looking simplest possible way use sessions:

ideal be:

  • sessions can fetched anywhere
  • it shouldn't matter whether or not given object loaded session , updated session b

its single-process gui application. current setting current_session_context_class thread. use static field session variable (which think causes of troubles) , fetch once.

thanks assistance!

cheers, reto

assuming you're not teaching orm, understanding of why these errors happen isn't part of knowledge students supposed come away etc etc etc , want hibernate work database wrapper can data use while learning other things.

this best bet:

statelesssession session = sessionfactory.openstatelesssession(); 

a stateless session "auto-commit mode orm" , close raw-jdbc wrapper hibernate gets. no sessions, no l1 caches, no persistence context. sql/hql returns objects.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -