[Biopython-dev] [Bug 2833] Features insertion on previous bioentry_id

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu May 21 15:04:40 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2833





------- Comment #9 from andrea at biodec.com  2009-05-21 11:04 EST -------
(In reply to comment #8)
> (In reply to comment #7)
> > However, the unit test doesn't reproduce your original issue. Hopefully
> > your pickled SeqRecord objects will help there...
> 
> Based on your example script in comment 6 with the pickled SeqRecord objects,
> but using MySQL, I get an IntegrityError as expected:
> 
> Traceback (most recent call last):
> ...
> IntegrityError: (1062, "Duplicate entry 'ENST00000334859-2-0' for key 2")
> 
> I get the same error with simplified records lacking any annotation or features
> (I just saved your three records to a FASTA file and reloaded them). So what
> ever is going wrong seems to be PostgreSQL specific (or at least, does not
> affect MySQL).

According to me it's postgres specific the fact that i don't have any 
error at all. If biopython expects from postgres an error in this 
situation there are some problem in postgres (or in mine).

> 
> I have updated test_BioSQL.py in CVS to cover more variations (revision 1.33),
> and hopefully the error message check should work on PostgreSQL as well. It
> would be very helpful if you could test that.

This is te results of the test: it's the same on python2.4 and python2.5:
Make sure can't import records with same ID (in one go). ... FAIL
Make sure can't import records with same ID (in steps). ... FAIL
Make sure can't import records with same ID (in steps with commit). ... FAIL
Make sure can't import a single record twice (in one go). ... FAIL
Make sure can't import a single record twice (in steps). ... FAIL
Make sure can't import a single record twice (in steps with commit). ... FAIL
Make sure all records are correctly loaded. ... ok
Make sure can't reimport existing records. ... FAIL
Indepth check that SeqFeatures are transmitted through the db. ... ok
Load SeqRecord objects into a BioSQL database. ... ok
Get a list of all items in the database. ... ok
Test retrieval of items using various ids. ... ok
Check can add DBSeq objects together. ... ok
Check can turn a DBSeq object into a Seq or MutableSeq. ... ok
Make sure Seqs from BioSQL implement the right interface. ... ok
Check SeqFeatures of a sequence. ... ok
Make sure SeqRecords from BioSQL implement the right interface. ... ok
Check that slices of sequences are retrieved properly. ... ok

======================================================================
FAIL: Make sure can't import records with same ID (in one go).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_BioSQL.py", line 397, in test_duplicate_id_load
    err.__class__.__name__ + "\n" + str(err))
AssertionError: Exception
Should have failed!

======================================================================
FAIL: Make sure can't import records with same ID (in steps).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_BioSQL.py", line 410, in test_duplicate_id_load2
    err.__class__.__name__ + "\n" + str(err))
AssertionError: Exception
Should have failed!

======================================================================
FAIL: Make sure can't import records with same ID (in steps with commit).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_BioSQL.py", line 424, in test_duplicate_id_load3
    err.__class__.__name__ + "\n" + str(err))
AssertionError: Exception
Should have failed!

======================================================================
FAIL: Make sure can't import a single record twice (in one go).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_BioSQL.py", line 361, in test_duplicate_load
    err.__class__.__name__ + "\n" + str(err))
AssertionError: Exception
Should have failed!

======================================================================
FAIL: Make sure can't import a single record twice (in steps).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_BioSQL.py", line 373, in test_duplicate_load2
    err.__class__.__name__ + "\n" + str(err))
AssertionError: Exception
Should have failed!

======================================================================
FAIL: Make sure can't import a single record twice (in steps with commit).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_BioSQL.py", line 386, in test_duplicate_load3
    err.__class__.__name__ + "\n" + str(err))
AssertionError: Exception
Should have failed!

======================================================================
FAIL: Make sure can't reimport existing records.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_BioSQL.py", line 463, in test_reload
    err.__class__.__name__ + "\n" + str(err))
AssertionError: OperationalError
currval of sequence "bioentry_pk_seq" is not yet defined in this session


----------------------------------------------------------------------
Ran 18 tests in 26.938s

FAILED (failures=7)


> 
> Part of the new tests is a slight variation on your original example.  Could
> you try this:
> 
> db.load([s1])
> server.commit()
> db.load([s2])
> server.commit()
> db.load([s3])
> server.commit()
> 
>>> ## LOAD INTO DB
>>> db.load([s1])
1
>>> server.commit()
>>> db.load([s2])
1
>>> server.commit()
>>> db.load([s3])
1
>>> server.commit()
>>>
i don't have any errors!!!

> This might tell us if the issue is with PostgreSQL not checking the key
> constraints until the commit.
> 
it seems that. If i try to do the insertion via SQL i don't have any
errors. I just have a message of the type:
INSERT 0 0
due to the fact the postgres doesn't insert anything.

Andrea


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list