??xml version="1.0" encoding="utf-8" standalone="yes"?>国产在线制服美女,久久久久久久久国产精品,亚洲国产综合在线观看http://www.aygfsteel.com/mac521/category/28846.htmlLove OpenSourcezh-cnTue, 15 Apr 2008 21:10:43 GMTTue, 15 Apr 2008 21:10:43 GMT60ȝ一下异怋?/title><link>http://www.aygfsteel.com/mac521/archive/2008/04/14/192701.html</link><dc:creator>风中赯</dc:creator><author>风中赯</author><pubDate>Mon, 14 Apr 2008 03:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/mac521/archive/2008/04/14/192701.html</guid><wfw:comment>http://www.aygfsteel.com/mac521/comments/192701.html</wfw:comment><comments>http://www.aygfsteel.com/mac521/archive/2008/04/14/192701.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mac521/comments/commentRss/192701.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mac521/services/trackbacks/192701.html</trackback:ping><description><![CDATA[  <p class="MsoNormal"><span lang="EN-US">Exception</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分ؓQ?/span><span lang="EN-US">Error</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span><span lang="EN-US">Exception(checkedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span><span lang="EN-US">uncheckedException)</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。在使用异常的时候可以先列出以下问题</span></p> <table class="MsoTableGrid" style="border-right: medium none; border-top: medium none; border-left: medium none; border-bottom: medium none; border-collapse: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing="0" cellpadding="0" border="1"> <tbody> <tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 142pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt" valign="top" width="189"> <p class="MsoNormal"><span lang="EN-US">Exception</span></p> </td> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0cm; border-left: medium none; width: 142.05pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" valign="top" width="189"> <p class="MsoNormal"><span lang="EN-US">Source</span></p> </td> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0cm; border-left: medium none; width: 142.05pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" valign="top" width="189"> <p class="MsoNormal"><span lang="EN-US">Scope</span></p> </td> </tr> <tr style="mso-yfti-irow: 1; mso-yfti-lastrow: yes"> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 142pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign="top" width="189"> <p class="MsoNormal"><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自定义异常名U?/span></p> </td> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: medium none; width: 142.05pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign="top" width="189"> <p class="MsoNormal"><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">会生自定义异常的方法或事g</span></p> </td> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: medium none; width: 142.05pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign="top" width="189"> <p class="MsoNormal"><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">调用</span><span lang="EN-US">Source</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的方法或对象</span></p> </td> </tr> </tbody> </table> <p class="MsoNormal"><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我认?/span><span lang="EN-US">uncheckedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span><span lang="EN-US">checkedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">要好Q因样可以减代码中</span><span lang="EN-US">try/catch</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语句Q利用异常处理框?/span><span lang="EN-US">(</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span><span lang="EN-US">filter)</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来统一处理产生的异常。那</span><span lang="EN-US">uncheckedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span><span lang="EN-US">checkedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">该如何划分呢Q?/span><span lang="EN-US">checkedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用来处理可以预知的情况,例如已有针对q回值的不同情况Q用</span><span lang="EN-US">If/else</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">判断。此时可以用</span><span lang="EN-US">checkedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提醒调用者对不同的情况做处理Q要比调用者自己查源代码然后做出相应的判断要好?/span><span lang="EN-US">uncheckedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用于抛出的异常,一般情况下是不可预知的Q会Dpȝ错误的。例如一个自定义的方法用来格式化日期Q它需要一个日期型的字W串Q可是偏偏系l传了一个空的字D串Q这U事很少发生的,所以不能抛Z?/span><span lang="EN-US">checkedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q不然会造成到处都是</span><span lang="EN-US">try/catch</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语句。此?/span><span lang="EN-US">uncheckedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以用了,在方法上加上</span><span lang="EN-US">@throws uncheckedException</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q调用者在不能定自己传入的参数是否合法时Q看到方?/span><span lang="EN-US">throw</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">异常Q就需?/span><span lang="EN-US">try/catch</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一下了?/span><span lang="EN-US">(@throws</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用来说明的是</span><span lang="EN-US">uncheckedException)</span></p> <p class="MsoNormal"><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在项目开发过E中Q用</span><span lang="EN-US">XDoclet+Exception</span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来约束调用者,效果会更好一些?/span></p> <img src ="http://www.aygfsteel.com/mac521/aggbug/192701.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mac521/" target="_blank">风中赯</a> 2008-04-14 11:14 <a href="http://www.aygfsteel.com/mac521/archive/2008/04/14/192701.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[Original]Java文g事务(commons-transaction)http://www.aygfsteel.com/mac521/archive/2008/01/17/175839.html风中赯风中赯Thu, 17 Jan 2008 01:46:00 GMThttp://www.aygfsteel.com/mac521/archive/2008/01/17/175839.htmlhttp://www.aygfsteel.com/mac521/comments/175839.htmlhttp://www.aygfsteel.com/mac521/archive/2008/01/17/175839.html#Feedback0http://www.aygfsteel.com/mac521/comments/commentRss/175839.htmlhttp://www.aygfsteel.com/mac521/services/trackbacks/175839.html今天上网看到apache的commons包中提供了一个TransactionQ可以控制文件的事务。做了测试,看是否可以成功?/p>

Commons-Transaction: http://commons.apache.org/transaction/
下面是测试的代码TestTransaction.java:
Log log = LogFactory.getLog(TestTransaction.class);
  //q个是commons-transaction包中的类
  LoggerFacade logger = new CommonsLoggingLogger(log);;
  //存储的\?br />   String toDir = "d:/";
  //临时路径
  String tempDir = "e:/";
  //构造函数的W三个参敎ͼfalseQ标识是否encoding文档的urlQ这个一般不需要设|ؓtrue
  FileResourceManager frm = new FileResourceManager(toDir, tempDir, false, logger);
  //q标识frm的状态ؓstart
  frm.start();
  //下面需要frm的状态ؓstart
  String txId = frm.generatedUniqueTxId();
  try {
   //开启Transaction
   frm.startTransaction(txId);
   frm.deleteResource(txId, "RFID.rtf");
//   throw new Exception("sdf");
  } catch (Exception e) {
   try {
    //回滚事务
    frm.rollbackTransaction(txId);
   } catch (ResourceManagerException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
   }
  }
  //提交事务
  frm.commitTransaction(txId);
在这个applicationq行q程中,会在tempDir产生一个时目?是由一些阿拉伯数字和字母组成的)Q里面有两个文g夹:change和deleteQ还有一个日志transaction.logQ而要操作的目录就会在delete目录中。事务的q程也是q样的:先将file存放的tempDirQ然后监控transaction的状态,如果commitQ它׃file写到destination中,然后删除tempDir。不q,既然apache已经有了q个Q就可以直接拿来用了.commons-transactionQ还支持jta的事务,希望来会更加强?



风中赯 2008-01-17 09:46 发表评论
]]>
[Translation]JSON与struts2http://www.aygfsteel.com/mac521/archive/2008/01/11/174653.html风中赯风中赯Fri, 11 Jan 2008 08:29:00 GMThttp://www.aygfsteel.com/mac521/archive/2008/01/11/174653.htmlhttp://www.aygfsteel.com/mac521/comments/174653.htmlhttp://www.aygfsteel.com/mac521/archive/2008/01/11/174653.html#Feedback0http://www.aygfsteel.com/mac521/comments/commentRss/174653.htmlhttp://www.aygfsteel.com/mac521/services/trackbacks/174653.html阅读全文

风中赯 2008-01-11 16:29 发表评论
]]>
[Original]Hibernate持久与游?/title><link>http://www.aygfsteel.com/mac521/archive/2008/01/09/173983.html</link><dc:creator>风中赯</dc:creator><author>风中赯</author><pubDate>Wed, 09 Jan 2008 05:28:00 GMT</pubDate><guid>http://www.aygfsteel.com/mac521/archive/2008/01/09/173983.html</guid><wfw:comment>http://www.aygfsteel.com/mac521/comments/173983.html</wfw:comment><comments>http://www.aygfsteel.com/mac521/archive/2008/01/09/173983.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mac521/comments/commentRss/173983.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mac521/services/trackbacks/173983.html</trackback:ping><description><![CDATA[<p style="font-family: Times New Roman">        在Hbibernate中有自己的一套机ӞFlushModeQ它控制着持久化对象与数据库的关系。FlushMode有四U状态:NERVER、AUTO、COMMIT和ALWAYS。默认gؓAUTO。Spring中用HibernateӞ会将FlushMode初始化ؓAUTOQ不q在使用OpenSessionInViewFilter(Spring有自q一个transcationQ不q它只是作用在service层,如果想持久化对象保留到view层,那么启用q个qo器之后就可以?qo器之后,Spring会将FlushMode讄为NERVER(表示持久化对象不在于数据库中数据实时兌)。不知道大家在工E中是否用到了spring提供的事务,在用到spring提供的HibernateTranscationManager理事务时。当调用的方法位于该理器之下时Qspring会时的FlushMode修改为AUTO状态,q样如果你在view层有一个持久化对象Qƈ且修改了q个持久化对象的状态,spring会自动将q个持久化对象的状态更新到数据库中厅R这样可能会带来困惑Q明明没有更新数据库Q怎么数据库中的值发生改变了呢?其实q也是持久层的意义所在:持久是将数据保存在持久层中的对象上,q对象与数据是一致的Q如果持久化对象状态发生改变,成ؓ了游L,cM用jdbc取出Object之后close了connectionQ这样对象与数据库就q了,也就是游R欢q大家来拍砖^_^</p> <img src ="http://www.aygfsteel.com/mac521/aggbug/173983.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mac521/" target="_blank">风中赯</a> 2008-01-09 13:28 <a href="http://www.aygfsteel.com/mac521/archive/2008/01/09/173983.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Т</a>| <a href="http://" target="_blank">Ͷ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʲ</a>| <a href="http://" target="_blank">ʹ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¦</a>| <a href="http://" target="_blank">人</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank">½</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ӽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">־</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ĩ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¡</a>| <a href="http://" target="_blank">ξ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>