[BioSQL-l] _removeSequence
Hilmar Lapp
hlapp at gnf.org
Mon Jun 20 16:05:26 EDT 2005
You should actually check whether InnoDB is enabled in your instance of
Mysql. Mysql has the "nice" behaviour of silently converting the table
manager to MyISAM if InnoDB has not been enabled in the instance. It
will not throw an error.
Up until at least 4.0.x InnoDB was disabled by default. You can check
whether it is enabled by issuing
mysql> show variables;
and then look for the have_innodb variable. It needs to have the value
of YES. The variables with innodb_ prefix will tell you where it
creates its tablespaces etc.
If it is not enabled, you need to edit Mysql's config file accordingly
and restart the Mysql daemon.
-hilmar
On Jun 20, 2005, at 3:20 AM, Martina wrote:
> My tables are all InnoDB tables and in the biosqldb-mysql.sql (v 1.40
> 2004/11/04 01:49:41) which created them, it says ON DELETE CASCADE.
> Do I need to do anything else?
>
> Thanks,
> Martina
>
> Richard HOLLAND wrote:
>
>> To do cascading deletes in MySQL requires the tables to have been set
>> up
>> using the InnoDB table style (as opposed to the default MyISAM
>> tables).
>> In InnoDB, foreign keys are actually enforced and deletes will
>> cascade,
>> whereas in MyISAM it has no concept of foreign keys and so is unable
>> to
>> enforce data integrity. The people on the BioSQL-L mailing list will
>> be
>> able to help you there.
>> The next version of BioJava's database interfaces after the 1.4
>> release
>> will assume that the underlying database does have cascading deletes
>> turned on. The existing version half-attempts to make up for the lack
>> of
>> cascading deletes in databases that don't support it, but it doesn't
>> do
>> it well at all, hence the problems you are seeing. After consulting
>> with
>> Hilmar last week we decided it was a fair assumption to make that all
>> BioSQL instances are installed with cascading deletes enabled.
>> BioPerl-db already makes this assumption.
>> cheers,
>> Richard
>> Richard Holland
>> Bioinformatics Specialist
>> GIS extension 8199
>> ---------------------------------------------
>> This email is confidential and may be privileged. If you are not the
>> intended recipient, please delete it and notify us immediately. Please
>> do not copy or use it for any purpose, or disclose its content to any
>> other person. Thank you.
>> ---------------------------------------------
>>> -----Original Message-----
>>> From: biosql-l-bounces at portal.open-bio.org
>>> [mailto:biosql-l-bounces at portal.open-bio.org] On Behalf Of
>>> mark.schreiber at novartis.com
>>> Sent: Monday, June 20, 2005 5:57 PM
>>> To: Martina
>>> Cc: biosql-l-bounces at portal.open-bio.org; BioJava;
>>> biosql-l at open-bio.org
>>> Subject: Re: [BioSQL-l] _removeSequence
>>>
>>>
>>> Biojava doesn't attempt to recusivley remove features by itself. It
>>> relies on cascading deletes in the database. I know Oracle can be
>>> set to do this (and it works very well). If MySQL has equivalent
>>> functionality you may need to turn it on. I'm pretty sure it does
>>> but you need to set it up.
>>>
>>> - Mark
>>>
>>>
>>>
>>>
>>>
>>> Martina <boehme at mpiib-berlin.mpg.de>
>>> Sent by: biosql-l-bounces at portal.open-bio.org
>>> 06/20/2005 05:43 PM
>>>
>>> To: biosql-l at open-bio.org, BioJava <biojava-l at biojava.org>
>>> cc: (bcc: Mark Schreiber/GP/Novartis)
>>> Subject: [BioSQL-l] _removeSequence
>>>
>>>
>>> Hi,
>>>
>>> Im trying to delete a sequence and recursivly all its features.
>>>
>>> So:
>>>
>>> for (SequenceIterator si = db.sequenceIterator(); si.hasNext();) {
>>> Sequence s = si.nextSequence();
>>> String name = s.getName();
>>> s = null;
>>> db.removeSequence(name);
>>> }
>>>
>>> But if I look in the database (MySQL 4.1.12) I can still see plenty
>>> of entries and I have problems entering the same features again,
>>> because of dublicate key error. I would like to know if
>>> _removeSequence(String) in BioSQLSequenceDB is supposed to remove
>>> features recursivly or just the features of the removed sequence?
>>> If so - what is the best way do delete the features of the features
>>> (and so on)? And how to empty the db completly?
>>>
>>> Martina
>>>
>>> _______________________________________________
>>> BioSQL-l mailing list
>>> BioSQL-l at open-bio.org
>>> http://open-bio.org/mailman/listinfo/biosql-l
>>>
>>>
>>>
>>> _______________________________________________
>>> BioSQL-l mailing list
>>> BioSQL-l at open-bio.org
>>> http://open-bio.org/mailman/listinfo/biosql-l
> _______________________________________________
> BioSQL-l mailing list
> BioSQL-l at open-bio.org
> http://open-bio.org/mailman/listinfo/biosql-l
>
--
-------------------------------------------------------------
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------
More information about the BioSQL-l
mailing list