Small comment on the 'uniqueness' of 'sequence_id'

On 10/26/2011 1:47 PM, Mark Diggory wrote:
>> My answer would be that bitstream 'sequence_id' should be unique
>> *per-Item*. Admittedly though, this doesn't seem to be documented anywhere.
>
> It has absolutely no uniqueness constraint on it in the database.
>
>     sequence_id             INTEGER

To be honest, the lack of uniqueness constraint in the DB doesn't mean 
it still shouldn't be unique per-Item.

If it did have a uniqueness constraint, that would force sequence_id to 
be unique across *all* bitstreams in the system.

sequence_id   INTEGER UNIQUE

Obviously, as we don't want a 'sequence_id' to be unique system-wide, 
that's why the above uniqueness constraint isn't a part of our database 
schema.

However, I still think that a 'sequence_id' is supposed to be unique 
per-Item. This uniqueness is not captured in the database schema, but it 
is captured via the Java API (see the Item.update() method, which 
attempts to ensure that no two bistreams in an Item have the same 
'sequence_id').

All that being said, obviously Mark Wood found out that we really aren't 
properly checking that a sequence_id is unique per Item.  All we are 
doing is attempting to ensure that, when you add bitstreams through the 
DSpace Java API (either via UI or CLI), each of those bitstreams will be 
assigned a sequence_id which is unique within its associated Item.

But, if "bad data" gets in your DB somehow (by bypassing our DSpace Java 
API), we aren't warning the user or telling the user that his/her data 
is "invalid" (which is what Mark Wood discovered the hard way).

- Tim

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to