第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

hibernate 報(bào)錯(cuò) nested transactions not supported

hibernate 報(bào)錯(cuò) nested transactions not supported

Bangk 2016-08-29 11:23:33
頁(yè)面代碼如下????<div?id="a"?class="panel-collapse?collapse?in"?role="tabpanel"?aria-labelledby="headingOne"> ??????<a?href="<%=path?%>/project/Project_query.action"?target="add"?class="list-group-item">所有項(xiàng)目</a> ?<button?type="button"?class="?list-group-item"?data-toggle="modal"?data-target="#myModal">創(chuàng)建項(xiàng)目</button> ??? ??? ???<div?class="modal?fade"?id="myModal"?tabindex="-1"?role="dialog"?aria-labelledby="myModalLabel"> ??<div?class="modal-dialog"?role="document"> ????<div?class="modal-content"> ??????<div?class="modal-header"> ????????<button?type="button"?class="close"?data-dismiss="modal"?aria-label="Close"><span?aria-hidden="true">&times;</span></button> ????????<h4?class="modal-title"?id="myModalLabel">Modal?title</h4> ??????</div> ??????<div?class="modal-body"> ????????<iframe?name="added"?src="jsp/project_added.jsp"?height="29%"?width="100%"?frameborder="0"?style="background-color:?#ccc"></iframe> ??????</div> ????</div> ??</div> </div> ??? ???<a?href="#"?class="list-group-item">修改項(xiàng)目</a> ???<a?href="#"?class="list-group-item">移除項(xiàng)目</a> ???<a?href="#"?class="list-group-item">演示項(xiàng)目</a> ???<a?href="#"?class="list-group-item">移交項(xiàng)目</a> ????</div> ??</body> <script?type="text/javascript"?src="js/jquery.js"></script> <script?type="text/javascript"?src="js/bootstrap.js"></script> ??<script> ???$(document).ready(function()?{ ?var?AdminName=document.referrer; ????if(AdminName==""){ ?????alert("非法訪(fǎng)問(wèn)!"); ?????window.location.href="login.jsp";?? ?}; }); $('#myModal').on('shown.bs.modal',?function?()?{ ??$('#myInput').focus() }) ??</script> </html>框架內(nèi)頁(yè)面代碼如下 <body?style="-moz-user-select:none;-webkit-user-select:none;"> ?<div?align="center"> ???<div?style="margin-bottom:?5px;"?class="jumbotron"> ????<h2>全部項(xiàng)目<a?title="刷新"?onclick="refresh()"><span?class="glyphicon?glyphicon-refresh"?aria-hidden="true"></span></a></h2> ???</div> ??<div?style="margin-top:?0px;margin-left:?15px;margin-right:?15px;"?class="panel?panel-success"> ???<!--?Default?panel?contents?--> ???<div?class="panel-heading">項(xiàng)目列表</div> ???<table?class="table"> ????<tr?align="center"> ?????<td>項(xiàng)目編號(hào)</td> ?????<td>項(xiàng)目名稱(chēng)</td> ?????<td>項(xiàng)目備注</td> ?????<td>項(xiàng)目狀態(tài)</td> ?????<td>項(xiàng)目操作</td> ????</tr> ????<s:iterator?value="#session.project_list"?var="pro"> ????<tr?align="center"> ?????<td><s:property?value="#pro.ProjectId"/></td> ?????<td><a?target=_blank?href="<s:property?value="#pro.ProjectUrl"/>"><s:property?value="#pro.ProjectName"/></a></td> ?????<td><s:property?value="#pro.ProjectRemark"/></td> ?????<td><span?class="glyphicon?<s:property?value="#pro.ProjectCondition"/>"?aria-hidden="true"></span></td> ?????<td><a?target=_blank?title="查看項(xiàng)目"?href="<s:property?value="#pro.ProjectUrl"/>"><span?class="glyphicon?glyphicon-eye-open"?aria-hidden="true"></span></a>?<a?title="修改項(xiàng)目"><span?class="glyphicon?glyphicon-pencil"?aria-hidden="true"></span></a>?<a?href="<%=path%>/project/Project_delete.action?pid=<s:property?value="#pro.ProjectId"/>"?title="刪除項(xiàng)目"??onclick="javascript:return?confirm('確認(rèn)刪除?');"?><span?class="glyphicon?glyphicon-trash"?aria-hidden="true"></span></a></td> ????</tr> ????</s:iterator> ???</table> ??</div> ??<h5>Copyright???2016?Kaiser.zsk?All?Rights?Reserved</h5> ?</div> </body> <script?type="text/javascript"?src="./js/jquery.js"></script> <script?type="text/javascript"?src="./js/bootstrap.js"></script> <script?type="text/javascript"> $(document).ready(function()?{ ????$(".1").addClass("glyphicon-ok"); ?$(".0").addClass("glyphicon-remove"); }); function?refresh(){? ????window.location.reload();//刷新當(dāng)前頁(yè)面.? ??//或者下方刷新方法? ??//parent.location.reload()刷新父親對(duì)象(用于框架)--需在iframe框架內(nèi)使用? ??//?opener.location.reload()刷新父窗口對(duì)象(用于單開(kāi)窗口? ??//top.location.reload()刷新最頂端對(duì)象(用于多開(kāi)窗口)? } </script> </html>后端代碼如下 ?/** ??*?項(xiàng)目查看接口 ??*?@return?項(xiàng)目實(shí)體模型組 ??*/ ?public?List<Project>?ProjectExamine()?{ ??Transaction?tx?=?null; ??List<Project>?list=?null; ??String?hql=""; ??try?{ ???Session?session?=?DaraBaseSessionFactory.getSessionFactory().getCurrentSession(); ???tx?=?session.beginTransaction(); ???hql?=?"from?Project"; ???Query?query?=?session.createQuery(hql); ???list?=?query.list(); ???tx.commit(); ???return?list; ??}?catch?(Exception?e)?{ ???e.printStackTrace(); ???tx.commit(); ???return?list; ??}finally{ ???if?(tx!=null)?{ ????tx?=?null; ???} ??} ?} }配置文件如下<package?name="project"?namespace="/project"?extends="default"> ??<action?name="*_*"?class="com.Action.{1}Action"?method="{2}"> ???<result?name="query_success">/jsp/project_query.jsp</result> ???<result?name="delete_success"?type="chain">Project_query</result> ???<result?name="added_success">/jsp/project_added_ok.jsp</result> ???<result?name="added_failure">/jsp/project_added_no.jsp</result> ???<result?name="added_over">/jsp/project_added_over.jsp</result> ??</action> ?</package>以上為實(shí)現(xiàn)報(bào)錯(cuò)頁(yè)面所需代碼!為什么會(huì)報(bào)錯(cuò)說(shuō) 我事件嵌套了??我每個(gè)動(dòng)作的事件都提交了?。。。?
查看完整描述

5 回答

已采納
?
yanrun

TA貢獻(xiàn)317條經(jīng)驗(yàn) 獲得超240個(gè)贊

網(wǎng)上看的解決辦法

tx?=?getSession().beginTransaction();

改成

?tx?=?getSession().beginTransaction().begin();

查看完整回答
反對(duì) 回復(fù) 2016-08-29
  • Bangk
    Bangk
    實(shí)際上這個(gè)對(duì)我沒(méi)用,但還是采納了,別人或許會(huì)用到,我修改了Hibernate框架源碼,把嵌套事件警告沉默了,哈哈哈,數(shù)據(jù)就有了
  • yanrun
    yanrun
    厲害啊
  • Bangk
    Bangk
    沒(méi)什么用虛擬機(jī)的注解禁止了Hibernate的事務(wù)類(lèi)輸出異常
點(diǎn)擊展開(kāi)后面1
?
weibo_那是什么叨_03580699

TA貢獻(xiàn)14條經(jīng)驗(yàn) 獲得超5個(gè)贊

需要的進(jìn)行回滾,不需要的就不使用事務(wù)

查看完整回答
反對(duì) 回復(fù) 2016-08-29
?
weibo_那是什么叨_03580699

TA貢獻(xiàn)14條經(jīng)驗(yàn) 獲得超5個(gè)贊

定義事務(wù)傳播行為?? 遇到異常全部回滾

查看完整回答
反對(duì) 回復(fù) 2016-08-29
?
摩訶迦葉

TA貢獻(xiàn)146條經(jīng)驗(yàn) 獲得超54個(gè)贊


finally{

?? if?(tx!=null)?{

??? tx.close();

????tx?=?null;

???}

session.close();

}

查看完整回答
反對(duì) 回復(fù) 2016-08-29
  • 5 回答
  • 0 關(guān)注
  • 2834 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)