草庐IT

circuit_breaking_exception

全部标签

java - Spring 交易: rollback on Exception or Throwable

我想知道用它代替是否有意义@Transactional(propagation=Propagation.REQUIRED,rollbackFor=Exception.class)使用Throwable@Transactional(propagation=Propagation.REQUIRED,rollbackFor=Throwable.class)据我了解,捕捉Error将帮助我们正确行事,即使发生了非常糟糕的事情。或者可能没有帮助? 最佳答案 AsIunderstandcatchingErrorwillhelpusbehavec

java - 为什么 Hibernate 会抛出 org.hibernate.exception.LockAcquisitionException?

我有这个方法:mymethod(longid){Personp=DAO.findPerson(id);Carcar=newCar();car.setPerson(p);p.getCars().add(car);DAO.saveOrUpdate(car);DAO.saveOrUpdate(p);DAO.delete(p.getCars().get(0));//Apersonhavemanycars}映射:Person.hbm.xml[0,n]-->汽车.hbm.xml此方法适用于单个线程,但在多个线程上,给我一个错误:02/08/2014-5:19:11p.m.-[pool-1-thre

java - 为什么 Hibernate 会抛出 org.hibernate.exception.LockAcquisitionException?

我有这个方法:mymethod(longid){Personp=DAO.findPerson(id);Carcar=newCar();car.setPerson(p);p.getCars().add(car);DAO.saveOrUpdate(car);DAO.saveOrUpdate(p);DAO.delete(p.getCars().get(0));//Apersonhavemanycars}映射:Person.hbm.xml[0,n]-->汽车.hbm.xml此方法适用于单个线程,但在多个线程上,给我一个错误:02/08/2014-5:19:11p.m.-[pool-1-thre

mysql - 使用 Spring、hibernate 和 C3P0 的设置重现 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

我从生产代码中得到了这个错误:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Thelastpacketsuccessfullyreceivedfromtheserverwas36940secondsago.Thelastpacketsentsuccessfullytotheserverwas36940secondsago,whichislongerthantheserverconfiguredvalueof'wait_timeout'.Youshouldconsidereitherexpiringand/ortestin

mysql - 使用 Spring、hibernate 和 C3P0 的设置重现 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

我从生产代码中得到了这个错误:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Thelastpacketsuccessfullyreceivedfromtheserverwas36940secondsago.Thelastpacketsentsuccessfullytotheserverwas36940secondsago,whichislongerthantheserverconfiguredvalueof'wait_timeout'.Youshouldconsidereitherexpiringand/ortestin

java - redis.clients.jedis.exceptions.JedisConnectionException : Could not get a resource from the pool

我试图用springBoot实现redis,我在我的本地主机上随机遇到以下异常:redis.clients.jedis.exceptions.JedisConnectionException:Couldnotgetaresourcefromthepool;我已经尝试过JedisPoolConfig的各种属性组合。但是他们都没有帮助不确定哪里出了问题。@ConfigurationpublicclassRedisConfigurationSetup{@BeanpublicRedisConnectionFactoryjedisConnectionFactory(){JedisPoolConf

Flutter : Exception on using Navigator. of(context) 用于 RaisedButton 的 onPressed 事件

我遇到了这个异常Exceptionhasoccurred.NoSuchMethodError(NoSuchMethodError:Themethod'ancestorStateOfType'wascalledonnull.Receiver:nullTriedcalling:ancestorStateOfType(Instanceof'TypeMatcher'))关于使用我为onPressed函数传递的自定义方法(navigateToLogin),对于RaisedButton,但是,当我直接在onPressed=(){...Navigationcode..}上编写相同的导航时,它工作正常

c# - 如何捕捉 "Unhandled win32 exception occured in AppName [procId]."

使用c#、VisualStudio2013、Windows应用商店应用有点长的解释创建一些使用JSON存储数据的简单Windows应用商店应用程序。数据量增加后,我开始收到消息AppName[procId]中发生未处理的win32异常。-请参见下图:我尝试减少JSON文件中存储的数据量,但在调试期间下类一段时间后,我再次收到此消息。所以情况-如果我有很多数据-我可以在应用程序中执行一些操作(很少意味着5)并得到这个异常,如果我有最少的数据量我可以使用应用程序更多一点(意味着12-17不同手术)。操作方式——读取文件、保存、加载页面等。我google了一下,发现了一些可能的原因:我必须按

c# - Exception 的 .ToString() 和 .Message 有什么区别?

我正在查看一些代码并找到了e.ToString()并且我想知道使用ToString()方法而不是.Message是否有区别?阅读下文,听起来它返回了更多信息。FromMicrosoft'sDocs到字符串受.NETCompactFramework支持。覆盖。创建并返回当前异常的字符串表示形式。留言受.NETCompactFramework支持。获取描述当前异常的消息。 最佳答案 如果您希望一次获得尽可能多的信息,请调用ToString():ThedefaultimplementationofToStringobtainsthenam

c# - 为什么抛出或捕获的类型必须派生自 System.Exception

出于好奇,我想看看异常类有什么特别之处,允许它与关键字Throw一起使用,而标准类则不能。我所发现的是Exception类实现了以下内容publicclassException:System.Object,System.Runtime.Serialization.ISerializable,System.Runtime.InteropServices._Exception{}所以我尝试实现那些相同的接口(interface)并尝试抛出我自己的自定义异常,该异常不是从System.Exception派生的,但无济于事。我只是被告知Thetypecaughtorthrownmustbede