org.springframework.orm.hibernate3.HibernateSystemException: Illegal attempt to associate a collection with two open sessions; nested exception is org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:744)
at com.huawei.cloud.util.baseDAO.impl.BaseDaoImpl.saveOrUpdateObject(BaseDaoImpl.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy78.saveOrUpdateObject(Unknown Source)
at com.huawei.cloud.service.impl.ComputingManagerServiceImpl.update(ComputingManagerServiceImpl.java:251)
at com.huawei.cloud.service.computing.JobTracer.errorClear(JobTracer.java:352)
at com.huawei.cloud.service.computing.JobTracer.run(JobTracer.java:106)
Caused by: org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
at org.hibernate.collection.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:432)
at org.hibernate.event.def.OnUpdateVisitor.processCollection(OnUpdateVisitor.java:66)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:124)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:84)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:78)
at org.hibernate.event.def.AbstractVisitor.process(AbstractVisitor.java:146)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:316)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:534)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:526)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:522)
at org.springframework.orm.hibernate3.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:747)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
... 17 more
解决方式1:this.getHibernateTemplate().merge(entity)
分享到:
相关推荐
4. SSH 架构中 Illegal attempt to associate a collection with two open sessions 问题 。 解决方法:使用 Hibernate 的 merge 方法代替 save、update 等方法。merge 方法可以把对象转变为托管状态的对象,而 ...
在使用C#与南大通用数据库(GBase)交互时,遇到的一个常见问题是尝试更新Blob或Clob(大型对象)时出现错误:“Illegal attempt to use Text/Byte host variable”。这个问题通常发生在利用CSDK中的ADO.NET驱动进行...
illegal access to protected memory(解决方案).md
今日遇到如下错误:java.security.InvalidKeyException: Illegal key size 因为美国法律限制,JAVA默认支持AES 128 Bit 的key, 如果你计划使用 192 Bit 或者 256 Bit key, java complier 会抛出 Illegal key size ...
Copy the file with .scr extension to your computers win directory (Windows for 98, Winnt for NT) and check in screens saver settings.<END><br>73,Cls_sample_Collection.zip Implement with Class and ...
在Java开发过程中,有时会遇到“illegal key size”这样的错误,这通常是由于Java加密相关的安全限制所导致的。这个问题在 JDK 7 版本中尤为常见,因为默认配置的Java Cryptography Extension (JCE) 有对密钥长度的...
在Java编程环境中,有时会遇到一个常见的错误:"java.security.InvalidKeyException: Illegal key size"。这个错误通常是由于Java安全策略的限制导致的,尤其是当你尝试使用超过默认限制的密钥长度(例如,超过128位...
Chapter 23 that implement part of the RSA cipher would be illegal to export out of the United States. Because messages encrypted with RSA are impossible to hack, the export of encryption software like...
ArrayIndexOutOfBoundException is thrown when we have to indicate that an array has been accessed with an illegal index. printStackTrace in jsp printStackTrace is a method of the Throwable class. By ...
对接微信接口中因为jdk8解密长度不够 报错 java.security.InvalidKeyException: Illegal key size 替换路径:(记得备份原有的文件) C:\Program Files\Java\jdk1.8.0_131\jre\lib\security
Your application is protected by two keys, one key is inside application it‘s a public key and the second it‘s a private key (that only the owner) which are used in combination to encrypt and ...
为了数据代码在传输过程中的安全,很多时候我们都会将要传输的数据进行...然而,在使用256位密钥加解密的时候,如果不进行特殊处理的话,往往会出现这个异常java.security.InvalidKeyException: Illegal key size。
illegal opcode(解决方案).md
google或者baidu一下,好多这样的问题,解决的方法都是修改php.ini,把allow_url_fopen给启用,改成 allow_url_fopen = On 这样做可以解决某些人的问题,有人说在php.ini中,有这样两个选项:allow_url_fopen =on...
在使用高版本版KEIL时,提示要升级固件,升级后就出现JLINK is Clone的提示!“the emulator is JLink-Clone, the segger software only support orginal segger device” 然后闪退,IDE崩溃关闭!...
在Java编程中,`java.security.InvalidKeyException: Illegal key size` 是一个常见的错误,通常出现在加密或解密操作中,尤其是涉及到对称加密算法如AES(高级加密标准)时。这个错误表明您试图使用的密钥长度不受...
Like talking to a brick wall... nothing happens 3 But JavaScript talks back 4 Lights, camera, interaction! 6 Use the [removed] tag to tell the browser you’re writing JavaScript 11 Your web browser ...
当在Java环境中使用AES加密时遇到 `java.security.InvalidKeyException: Illegal key size or default parameter` 这个异常,通常意味着密钥的长度超过了Java安全策略所允许的最大值。具体来说: - **非法密钥大小...
Introduction This book is designed to help all...First, my special thanks to my friend Linda and my family, who tolerated my late−night sessions and my bad mood in the mornings when I had to go to work.
In consideration of your agreeing to abide by the terms of this License and subject to your compliance with the terms of this License, Piriform grants you a non-exclusive, non-transferable license to ...