`
javaroom
  • 浏览: 10164 次
  • 性别: 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  
总是被评为入门贴,又没有回答,老子也解决了。

相关推荐

    Use Case Driven Object Modeling with UML.pdf

    ICONIX Process is a “cookbook” process in that it describes a series of specific steps that we’ve found work really well on many different projects. However, it doesn’t prescribe the project life-...

    Cross-platform.UI.Development.with.Xamarin.Forms.1784391190

    This book is intended for mobile software developers who are fed up with having three different code sets for the same application. If you want to put your code on all mobile platforms with minimum ...

    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 ...

    NameService

    Different names can be bound to an object in the same or different contexts at the same time. There is no requirement, however, that all objects must be named. To resolve a name is to determine ...

    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 ...

    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. ...

    Learning.Object-Oriented.Programming.1785289632

    You will explore how to maximize code reuse by writing code capable of working with objects of different types, and discover the advantage of duck typing in both Python and JavaScript, while you work ...

    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...

    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 ...

    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....

    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...

    Object Oriented Programming with Swift 2(PACKT,2016)

    Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects; these are data structures that contain data in the form of fields, often known as attributes and code. ...

    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-...

    Springer.Introduction.to.Assembly.Language.Programming.For.Pentium.and.RISC.Processors.With.75.Illustrations.2005.pdf

    The objective of this book is to introduce assembly language programming. Assembly language is very closely linked to the underlying processor architecture and design. Popular processor designs can be...

    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 ...

    Object Recognition with Color Cooccurrence Histograms

    We use the color cooccurrence histogram (CH) for recognizing objects in images. The color CH keeps track of the number of pairs of certain colored pixels that occur at certain separation distances in ...

    Beyond.BIOS.Developing.with.the.UEFI.3rd.epub

    This book provides an overview of modern boot firmware, including the Unified Extensible Firmware Interface (Uefi) and its associated Efi Developer Kit Ii (Edkii) firmware. The authors have each made ...

Global site tag (gtag.js) - Google Analytics