Bug 401581

Summary: EclipseLink nosql does not recognize unique constrains with mongodb
Product: z_Archived Reporter: Jürgen Stadler <mail>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: critical    
Priority: P2 CC: jamesssss, jmcollin92, mail, tom.ware
Version: unspecifiedKeywords: consistency, core, noteworthy
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: mongodb

Description Jürgen Stadler CLA 2013-02-22 19:15:06 EST
When adding a unique constraint like  db.users.ensureIndex({username: 1}, {unique: true}) the entity manager just ignores this when persisting an entry with a conflicting username.
Comment 1 Jürgen Stadler CLA 2013-02-22 19:18:13 EST
The mongo-db-driver used is version 2.10.0
Comment 2 Tom Ware CLA 2013-04-03 09:00:15 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 3 James Sutherland CLA 2013-05-27 10:40:50 EDT
Does Mongo throw an error for this constraint?  If Mongo does not validate constraints, there is nothing EclipseLink can do.

Check your log, are there any errors?
Comment 4 jm collin CLA 2013-05-27 11:29:19 EDT
Hi James,

> Check your log, are there any errors?

No, there is no error. The instruction is ignored. It may be a very insteresting feature to add if possible.

JM.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:33:28 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink