duplicate « Insert « JPA Q&A





1. INSERT ON DUPLICATE IGNORE with hibernate    forum.hibernate.org

HI! Somehow, always my hibrenate throws: java.sql.BatchUpdateException: Duplicate entry '105-213' for key 1 When the database doesn't have a duplicate record! it seems to me that it's trying to update although i don't ask it to do it. I thought, as a temporarily solution, to use on duplicate ignore. How do i ask Hibernate to use it? As well, what could ...

2. Multi thread, duplicate inserts    forum.hibernate.org

Hi all, I have an environment where multiple threads insert "message" objects. Each message object has 1 related parent record, which just before the insert I query for that parent record and if found in the database, then I assign that object into the message object. I have cascade="save-update" set. So if my related records do not exist they will get ...

3. Duplicate entry error when inserting a new record    forum.hibernate.org

Hi, I'm using Hibernate 2.1.1 with Mysql 3.23. I'm trying to autogenerate id's which are of type long. When I try to insert a new record, I get the message: java.sql.SQLException: Invalid argument value, message from server: "Duplicate entry '0' for key 1" Here's the relevant portion of the mapping fille: Here's ...

4. detecting duplicate insert    forum.hibernate.org

There is not common method unfortunatly. This kind of root exception is DB vendor specific. So you'll need to do : - try to read the entry before inserting it if you expect a high rate of failure - check the exception cause hierarchy to find your DB specific exception and rethrow your business exception. I know this could be a ...

5. Duplicate inserts in a many-to-many table    forum.hibernate.org

6. Duplicate when insert    forum.hibernate.org

Is it hibernate stable (2.1.3) (With OSCache)? I have a little project that only manage one table but it is used by a lot of users (More than 1000 users). The project will browse a row in table, then submit. During submit, application will delete that row and then insert one with new data. In some time, hibernate reported duplicate key ...

7. duplicate column problem on insert    forum.hibernate.org

Author Message jaybee Post subject: duplicate column problem on insert Posted: Wed Jan 05, 2005 8:06 am Newbie Joined: Thu Dec 23, 2004 2:28 pm Posts: 4 Hi, I have a struts app that I am converting to hibernate 2.1 and am seeing the id property of my class appear twice in queries - no problem on select but ...

8. duplicate column on insert with Oracle    forum.hibernate.org

Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message spob Post subject: duplicate column on insert with Oracle Posted: Fri Jan 21, 2005 3:58 am Newbie Joined: Wed Jan 07, 2004 6:36 pm Posts: 4 I'm using hibernate3, with Oracle 10G and am getting a ...

9. Simple iteration generates inserts that fail (duplicate key)    forum.hibernate.org

Hii, I am inserting new objects in the DB, closing a transaction and then attemtping to read the objects again in a diff. transaction. This seems to work until the last commit (after iterating through the listed objects). I get an exception due to a violated constraint. It seems that hHibernate is attemtpting to insert the object again. Can anyone point ...





10. Preventing duplicate inserts    forum.hibernate.org

The application were building has the following use-case: 1) Look up all active invoices for a customer, if an active invoice does not exist create one. 2) Add a line item to the active invoice (either found or newly created) This functionality, is used to make a monthly invoices for the customers. Problem being that if no active invoices exist, and ...

11. Duplicate record insertion problem    forum.hibernate.org

The is just a question to see if Hibernate will handle something for me or if I need to change my code and/or database. I have an Oracle table named Location with two fields: LocationID (Long primary key generated by an Oracle Sequence) and LocationName (Varchar2). The LocationName field should always be unique. I have a MessageDrivenBean (MDB) in Java that ...

13. Hibernate is inserting two(or duplicate) records.    forum.hibernate.org

Hi All, I have a table 'user_application_map' with NO PRIMARY KEY. This table has 2 columns (user_id & application_id). Both these columns are primary key in another table. user_id is primary key of "m_its_users" table & application_id is primary key of "m_applications". From front-end when I am trying to insert data then 2(or duplicate) rows are getting inserted. Here is my ...

14. 'Attempt to insert duplicate key row    forum.hibernate.org

Newbie Joined: Wed Jan 28, 2009 12:45 pm Posts: 2 I get 'Attempt to insert duplicate key row in object' error when my application tries to insert a row. Only way I could get rid of the error is by taking out hashcode and equal method. I tried implementing hash code and equal method different ways (hashCode builder, eclipse generated etc) ...