`
javaroom
  • 浏览: 10554 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

先删除后插入而且在两个事务中,为什么总是报a different object with the same....

阅读更多
我利用jpa调用hibernate实现数据存储,有一个操作是先删除后插入,但是当删除的与要插入的相同时,会报a different object with the same identifier value was already associated with the session异常,但是我在删除的时候,事务已经提交了,为什么总是查出id相同呢?我自己写了一个方法,每次插入时要先查一下,看看有没有相同的,如果有就update,没有就save,但是又出现了另一个问题:查出有记录,所以merge,但是实际却没有,所以update没起作用,导致相同的被删除了,只能插入不相同的记录,这怎么解决?
分享到:
评论
1 楼 javaroom 2007-10-26  
总是被评为入门贴,又没有回答,老子也解决了。

相关推荐

    3D Object Detection with Latent Support Surfaces

    We develop a 3D object detection algorithm that uses latent support surfaces to capture contextual relationships in indoor scenes. Existing 3D representations for RGB-D images capture the local shape ...

    Foundations.of.Object.Oriented.Languages.pdf

    I wrote this book to provide a description of the foundations of statically typed class-based object-oriented programming languages for those interested in learning about this area. An important goal ...

    Object Tracking A Survey

    The goal of this article is to review the state-of-the-art tracking methods, classify them into different categories, and identify new trends. Object tracking, in general, is a challenging problem. ...

    C++标准库(第二版)英文版.pdf

    The C++ Standard Library A Tutorial and Reference (2nd Edition)+cppstdlib-code.zip C++标准库(第二版)英文版.pdf 非扫描版+源代码 Prefaceto the SecondEdition xxiii Acknowledgments for the Second...

    计算机网络第六版答案

    In these systems, packets are transmitted over the same wireless infrastructure used for cellular telephony, with the base station thus being managed by a telecommunications provider. This provides ...

    pyr.tar.gz_All They Need_opncv_pyramid

    But in some occassions, we need to work with images of different resolution of the same image. For example, while searching for something in an image, like face, we are not sure at what size the ...

    hibernate常见异常

    a different object with the same identifier value was already associated with the session 是一种常见的异常,通常是由于在 Hibernate 中同一个 session 里面有了两个相同标识但是是不同实体所致。解决方案有...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: In "Windows ClearType" font rendering mode (OS Windows mode) the "garbage" pixels can appear from the right and from the bottom sides of the painted rectangle of the TFlexText object....

    OpenCV 3.x with Python By Example, 2nd Edition-Packt Publishing(2018).pdf

    This book is a practical tutorial that covers various examples at different levels, teaching you about the different functions of OpenCV and their actual implementations. Who this book is for This ...

    Mastering Object-oriented Python 2014.pdf

    This means exploring design alternatives and determining which design offers the best performance while still being a good fit with the problem that is being solved. Most of the book will look at a ...

    Fast.Data.Processing.Systems.with.SMACK.Stack

    You will start off with introduction to SMACK and when to use the same. In the later chapters you will be deep diving into the different aspects of SMACK. You will be starting with functional thinking...

    High Performance in-memory computing with Apache Ignite.pdf

    This book covers a verity of topics, including in-memory data grid, highly available service grid, streaming (event processing for IoT and fast data) and in-memory computing use cases from high-...

    Learn.With.AngularJS.Bootstrap.and.ColdFusion

    Each entry in the series builds the same application, using different technologies. This book uses AngularJS and Bootstrap for the user Interface, with ColdFusion powering live services. The books ...

    Java邮件开发Fundamentals of the JavaMail API

    A general familiarity with object-oriented programming concepts and the Java programming language is necessary. The Java language essentials tutorial can help. copyright 1996-2000 Magelang ...

    ZendFramework中文文档

    Fetching a Row as an Object 10.3. Zend_Db_Profiler 10.3.1. Introduction 10.3.2. Using the Profiler 10.3.3. Advanced Profiler Usage 10.3.3.1. Filter by query elapsed time 10.3.3.2. Filter by ...

    Building.a.Recommendation.System.with.R.1783554495

    Learn the art of building robust and powerful recommendation engines using R About This Book Learn to exploit various data mining techniques Understand some of the most popular recommendation ...

Global site tag (gtag.js) - Google Analytics