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 - Why does JDO think this detached object is clean? -


i trying learn jdo (and @ same time gae , spring intricacies) creating small web app, , having trouble getting updated domain objects persist database. grab entity db , detach can show user , allow them change it. once user has made changes , posts form app, again grab entity db (detached), update properties, , call pm.makepersistent(). abbreviated code follows:

user domain object:

@persistencecapable(detachable="true") public class user extends baseentity {     @persistent     private string firstname = "";     @persistent     private string middleinitial = "";     @persistent     private string lastname = ""; } 

dao read method:

public user read(key key) throws dataexception {     persistencemanager pm = pmf.get().getpersistencemanager();     user pkg, detached = null;     try {         pkg = (user) pm.getobjectbyid(user.class, key);         detached = pm.detachcopy(pkg);         detached.setisalreadyindb(true);     }     catch (exception e) {                    throw new dataexception("an error occured trying read user object. details:\n" + e.getmessage());     }     {         pm.close();     }     return detached; } 

dao update method:

private void update(user pkg) throws dataexception {     persistencemanager pm = pmf.get().getpersistencemanager();     transaction tx = pm.currenttransaction();      try {          tx.begin();                  pm.makepersistent(pkg);         tx.commit();     }     {          if (tx.isactive()) tx.rollback();         pm.close();     } } 

now when down update method, i've proven myself i'm working same object read via inspecting hashcode(), i've changed value using domain object's setter method, i've printed changed value console make sure it's getting done, , jdohelper.isdirty() still returns false, , therefore none of changes persisted database. thoughts on i'm missing or if i'm approaching wrong angle? thank helping out jdo beginner!

jdohelper.isdirty managed objects. detached object not managed. datanucleus provides helper method of own dirty fields while detached since logic implementation-specific string[] dirtyfieldnames = nucleusjdohelper.getdetachedobjectdirtyfields(obj, pm);


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 -