锘??xml version="1.0" encoding="utf-8" standalone="yes"?>超碰97久久国产精品牛牛,狠狠色伊人亚洲综合网站l,国产区一区二区三区http://www.aygfsteel.com/andy199999/category/10906.html-----------------MSN:andy1999999@163.com<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-----------------QQ:106256951 <bgsound src="http://club.whinfo.net.cn/bbs/upfile/2005-7/mp3/20057101738283.mp3" loop="-1"><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-----------------浜轟負鍠?紱忚櫧鏈嚦紲稿凡榪滅; 浜轟負鎭?紲歌櫧鏈嚦紱忓凡榪滅 zh-cnSat, 26 Jul 2008 08:59:07 GMTSat, 26 Jul 2008 08:59:07 GMT60Difference between getCurrentSession() and openSession() in hibernate.http://www.aygfsteel.com/andy199999/archive/2008/07/25/217382.html<a target=_blank>104浜哄姏閾惰</a><a target=_blank>104浜哄姏閾惰</a>Fri, 25 Jul 2008 02:32:00 GMThttp://www.aygfsteel.com/andy199999/archive/2008/07/25/217382.htmlhttp://www.aygfsteel.com/andy199999/comments/217382.htmlhttp://www.aygfsteel.com/andy199999/archive/2008/07/25/217382.html#Feedback0http://www.aygfsteel.com/andy199999/comments/commentRss/217382.htmlhttp://www.aygfsteel.com/andy199999/services/trackbacks/217382.html 鍘熸枃鏉ヨ嚜錛?/font> http://www.techfaq360.com/viewFreshers.jsp?tutorialId=840
getCurrentSession() :
The "current session" refers to a hibernate Session bound by hibernate behind the scenes, to the transaction scope.
A Session is opened when getCurrentSession() is called for the first time and closed when the transaction ends.
It is also flushed automatically before the transaction commits. You can call getCurrentSession() as often and anywhere you want as long as the transaction runs.
To enable this strategy in your hibernate configuration:

set hibernate.transaction.manager_lookup_class to a lookup strategy for your JEE container
set hibernate.transaction.factory_class to org.hibernate.transaction.JTATransactionFactory

Only the Session that you obtained with sf.getCurrentSession() is flushed and closed automatically.

Example :
try {
UserTransaction tx = (UserTransaction)new InitialContext()
.lookup("java:comp/UserTransaction");

tx.begin();

// Do some work
sf.getCurrentSession().createQuery(...);
sf.getCurrentSession().persist(...);

tx.commit();
}
catch (RuntimeException e) {
tx.rollback();
throw e; // or display error message
}

openSession() :
If you decide to use manage the Session yourself the go for sf.openSession() , you have to flush() and close() it.
It does not flush and close() automatically.
Example :
UserTransaction tx = (UserTransaction)new InitialContext()
.lookup("java:comp/UserTransaction");

Session session = factory.openSession();

try {
tx.begin();

// Do some work
session.createQuery(...);
session.persist(...);

session.flush(); // Extra work you need to do

tx.commit();
}
catch (RuntimeException e) {
tx.rollback();
throw e; // or display error message
}
finally {
session.close(); // Extra work you need to do
}


104浜哄姏閾惰 2008-07-25 10:32 鍙戣〃璇勮
]]>
struts2 for eclipse plugin涓嬭澆 (eclipse struts2鎻掍歡涓嬭澆)http://www.aygfsteel.com/andy199999/archive/2008/05/30/204098.html<a target=_blank>104浜哄姏閾惰</a><a target=_blank>104浜哄姏閾惰</a>Fri, 30 May 2008 07:18:00 GMThttp://www.aygfsteel.com/andy199999/archive/2008/05/30/204098.htmlhttp://www.aygfsteel.com/andy199999/comments/204098.htmlhttp://www.aygfsteel.com/andy199999/archive/2008/05/30/204098.html#Feedback0http://www.aygfsteel.com/andy199999/comments/commentRss/204098.htmlhttp://www.aygfsteel.com/andy199999/services/trackbacks/204098.htmleclipse struts2鎻掍歡涓嬭澆


104浜哄姏閾惰 2008-05-30 15:18 鍙戣〃璇勮
]]>
appfuse1.8.0瀹夎app_user.enabled data type (1111, 鈥榖it鈥? not recognized and will be ignored閿欒瑙e喅鍔炴硶http://www.aygfsteel.com/andy199999/archive/2006/10/26/77395.html<a target=_blank>104浜哄姏閾惰</a><a target=_blank>104浜哄姏閾惰</a>Thu, 26 Oct 2006 06:15:00 GMThttp://www.aygfsteel.com/andy199999/archive/2006/10/26/77395.htmlhttp://www.aygfsteel.com/andy199999/comments/77395.htmlhttp://www.aygfsteel.com/andy199999/archive/2006/10/26/77395.html#Feedback0http://www.aygfsteel.com/andy199999/comments/commentRss/77395.htmlhttp://www.aygfsteel.com/andy199999/services/trackbacks/77395.html錛堣漿杞斤級榪欎釜鏄疍Bunit鐨勯棶棰橈紝1.8浠ヤ笂鐨勭増鏈墠鏈夎繖涓棶棰橈紒

鍙淇敼User.java

/**
聽聽聽聽 * @return Returns the enabled.
聽聽聽聽 * @hibernate.property column="enabled"聽
聽聽聽聽 */
聽聽聽 public Boolean getEnabled() {
聽聽聽聽聽聽聽 // isEnabled doesnt' work for copying properties to Struts ActionForms
聽聽聽聽聽聽聽 return enabled;
聽聽聽 }

淇敼鎴?br />
/**
聽聽聽聽 * @return Returns the enabled.
聽聽聽聽 * @hibernate.property column="enabled" type="yes_no"
聽聽聽聽 */
聽聽聽 public Boolean getEnabled() {
聽聽聽聽聽聽聽 // isEnabled doesnt' work for copying properties to Struts ActionForms
聽聽聽聽聽聽聽 return enabled;
聽聽聽 }

灝卞姞浜嗚繖涓鐐癸紝灝卞彲浠ヤ簡錛?br />
鍏跺疄 type="yes_no" hibernate浼氭槧灝勬垚CHAR(1) , 鑰宼ype="boolean" 瀹冧細鏄犲皠鎴怋IT , 浼拌dbunit鍦ㄦ彃鍏ample-data.xml鐨勬椂鍊欎細鍑洪敊銆?


104浜哄姏閾惰 2006-10-26 14:15 鍙戣〃璇勮
]]>
struts閲嶅鎻愪氦http://www.aygfsteel.com/andy199999/archive/2006/05/09/45256.html<a target=_blank>104浜哄姏閾惰</a><a target=_blank>104浜哄姏閾惰</a>Tue, 09 May 2006 10:14:00 GMThttp://www.aygfsteel.com/andy199999/archive/2006/05/09/45256.htmlhttp://www.aygfsteel.com/andy199999/comments/45256.htmlhttp://www.aygfsteel.com/andy199999/archive/2006/05/09/45256.html#Feedback0http://www.aygfsteel.com/andy199999/comments/commentRss/45256.htmlhttp://www.aygfsteel.com/andy199999/services/trackbacks/45256.html聽聽聽聽聽聽瑙e喅榪欎釜闂鏈夊ソ鍑犵鍔炴硶錛屾垜涓嬮潰涓懼嚭涓縐嶇敤Token瑙e喅鐨勫姙娉曪紝甯屾湜澶у鎶婅嚜宸辯殑瑙e喅鍔炴硶鍙戣〃鍑烘潵錛岀敤Token瑙e喅闇瑕佹敞鎰忓嚑鐐癸紝涓鐐歸鍏堢▼搴忕殑鍏ュ彛搴旇鏄竴涓猘ction,鑰屼笉鏄痡sp,榪欎釜action鐨勪綔鐢ㄥ氨鏄敓鎴恡oken錛岀劧鍚庤漿鍚慾sp欏甸潰錛岀劧鍚庤繖涓猨sp欏甸潰閲岄潰鐨勬彁浜ゆ寜閽細鎻愪氦鍒板彟澶栦竴涓猘ction,榪欎釜action鑾峰緱琛ㄥ崟閲岄潰鐨勬暟鎹紝鐒跺悗鍒ゆ柇鏄笉鏄噸澶嶆彁浜?isTokenValid(request,true)銆傚鏋滀負true鎵ц鏁版嵁搴撴柟闈㈢殑鎿嶄綔銆俧alse鏄〃鍗曢噸澶嶆彁浜わ紝鎵ц鍏跺畠鎿嶄綔銆?br />聽聽聽聽聽聽InitInsertAction.java
聽聽聽聽聽聽聽聽聽聽聽聽//鐢熸垚鍚屾浠ょ墝閬垮厤琛ㄥ崟閲嶅鎻愪氦
聽聽聽聽聽聽saveToken(request);聽聽
聽聽聽聽聽聽return mapping.findForward(IConstants.SUCCESS_KEY);

聽聽聽聽聽 InsertAction.java
聽聽聽聽聽聽
聽聽聽聽聽聽NewsModel newsModel = new NewsModel();
聽聽聽聽聽//瀵硅薄鍙嶅皠鏈哄埗
聽聽聽聽聽BeanUtils.copyProperties(newsModel,newsForm);
聽聽聽聽聽newsModel.setNewsPublishTime(DateUtil.getCurrentTime());
聽聽聽聽聽newsModel.setNewsKind(newsForm.getNewsKind());
聽聽聽聽聽newsModel.setNewsContent(content);
聽聽聽聽聽//鍥劇墖鏂囦歡璺緞
聽聽聽聽聽if(imageFile!=null&&!imageFile.equals("")){聽聽聽
聽聽聽聽聽聽newsModel.setImagePath("/UploadFiles/"+imageFile);
聽聽聽聽聽}
聽聽聽聽聽//灝忓浘鐗囨枃浠惰礬寰?br />聽聽聽聽聽/**if(iconFile!=null&&!iconFile.equals("")){聽聽聽
聽聽聽聽聽聽newsModel.setIconPath("/UploadFiles/"+iconFile);
聽聽聽聽聽}*/
聽聽聽聽聽//鏁版嵁搴撴柟闈㈢殑澶勭悊#鎻掑叆涓鏉℃柊闂?br />聽聽聽聽聽INewsDao newsDao = new JdbcNewsDaoImpl(con);
聽聽聽聽聽newsDao.insertNews(newsModel);
聽聽聽聽}else{
聽聽聽聽聽//琛ㄥ崟閲嶅鎻愪氦
聽聽聽聽聽if(log.isDebugEnabled()){
聽聽聽聽聽聽log.debug("琛ㄥ崟閲嶅鎻愪氦");
聽聽聽聽聽}
聽聽聽聽}
聽聽聽



104浜哄姏閾惰 2006-05-09 18:14 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 漠河县| 武功县| 罗江县| 罗平县| 贵州省| 武平县| 孟村| 华坪县| 深泽县| 永丰县| 电白县| 会东县| 通城县| 长顺县| 海晏县| 安宁市| 大冶市| 大余县| 云霄县| 布尔津县| 南昌县| 故城县| 双流县| 庆元县| 武清区| 洞口县| 集安市| 贵港市| 佛学| 景德镇市| 会宁县| 永修县| 阳朔县| 天峻县| 浑源县| 绥中县| 庆元县| 嵊泗县| 岱山县| 泰来县| 临城县|