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 - One entityManger finds entity , the other does not -


i have strange behavior in program. have 2 classes (class login , creategame) have injected entitymanager in each using annotation

  @persistencecontext(unitname="myunitpu")   entitymanager entitymanger; 

in point remove object called "user" database using entitymanger.remove(user) method in login class. business logic user can host , join games ( in same time) removing user entries in database games user has created removed , entries showing in games user has joined removed also.

after that, call function checks if user exists using method in login class

  entitymanager.find(user) 

which surprisingly enough, finds user. after call method in creategame class tries find user using again

  entitymanger.find(user)  

the entitymanger in class fails find user (which expected result user removed , it's not in database)

so question : why entitymanager in 1 class finds user (which wrong) other doesn't find it? has ever same problem?

ps : "bug" occurs when user has hosted game joined user (lets call him buser) , buser has made game joined current user.

 game  |  host  | clients     game1 |  user  | userb  game2 |  userb | user 

where in case removing user, game1 deleted , user removed game2 result is

 game  |  host  | clients     game2 |  userb |  

ps2 : beans ejb3.0. methods called delegate class. beans in delegate class instantiated using initialcontext.lookup() method. note logging in ,creating , joining games appropriate delegate class calls correspondent ejb transactions. in case of logout, delegate calls ejb logout user becuase other stuff must done (as said above) ejb calls other ejb (again using lookup() ) has methods removegame(), removeuserfromgame() etc. after methods executed user logged out. maybe has fact the first entity manager called delegate second inside ejb , thats why 1 entitymanger can see non-existent user while other cannot? methods have transactiontype.required

thank in advance

i suppose the user object detached , out of sync database. taken cache. not using extended persistence context within stateful session bean. entity managed within transaction entity manager. try search user pk id.


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 -