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 - multi threaded servlet; single threaded ejb -


in traditional n tier web app servlets web layer , ejbs(2.0) biz layer, rationale behind making servlet model multi threaded , ejb model single threaded?
i.e there 1 servlet instance requests, ejbs, each request, there new bean instance assigned bean pool.

there indeed 1 instance specific servlet since supposed stateless. in practice isn't case, it.

there multiple instances of stateless session beans (slsb), , pooled.

by definition, stateless session beans stateless, on surface seems paradox. things while stateless session beans stateless respect individual calls being made them, in fact have state.

this state in form of references other resources. jpa entity manager, not thread-safe, prime example here. during single call stateless session bean, caller must have exclusive access resource. when call returns, next caller can have exclusive access, etc.

if single instance used, either callers have wait on each other (which of course killing performance), or have access single instance concurrently. in latter case, bean implementor has manual locking of non thread-safe resources entity manager brittle, error-prone , in end still causes callers wait on each other.

so, in order improve performance , still have safety guarantee, multiple instances being used.

those instances being pooled , re-used instead of created fresh each request, because finding, initializing , injecting required dependencies of bean can potentially time consuming.

all of automatically means if inject entity manager or other non thread-safe resource servlet (which allowed), may run problems. small loop-hole in java ee architecture, of course worked around making use of stateless session beans.


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 -