java - Is it safer to inject an EVENT scoped bean into a CONVERSATION/SESSION scoped bean? -



java - Is it safer to inject an EVENT scoped bean into a CONVERSATION/SESSION scoped bean? -

is safe inject beans narrower scope wide scoped bean?

does seam cdi take care of figure out current event/request/page context right injection session/conversation bean.

my point is. don't want 1 page/even's objects getting mixed other page/event's data.

i can utilize component.getinstance() within method create sure current event/page's beans anyway. utilize @in(scope = scopetype.event) this.

session , page scoped components synchronized per default. therefore, should safe inject event-scoped component, such entitymanager, them. synchronized, 2 request won't interfere 2 different injected objects.

to sure, don't run concurrency problems, recommend don't inject these components fetch them component repository:

mycomponent mycomponent = (mycomponent) component.getinstance("mycomponent");

java java-ee dependency-injection seam

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -