From: Ricardo B. <rb...@gm...> - 2006-01-17 19:36:33
|
Hi Angel, It is all right now with versioning tables. Now I passed to a next error. It follows below the error that happened. I am using the revision 4422 Do you have any idea ? ERROR: In feature map XML file '/GUS/gus_home/config/genbank2gus.xml' <feature name=3D"mRNA"> does not have a <qualifier> for 'transcript_id', which is fo= und in the input at /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm line 106, <GEN30> line 569. STACK TRACE: at /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm line 106 GUS::Supported::BioperlFeatMapper::_checkTagExists('GUS::Supported::Bioperl= FeatMapper=3DHASH(0xa7d23cc)', 'transcript_id') called at /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm line 30 GUS::Supported::BioperlFeatMapper::sortTags('GUS::Supported::BioperlFeatMap= per=3DHASH(0xa7d23cc)', 'db_xref', 'locus_tag', 'product', 'transcript_id') called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 800 GUS::Supported::Plugin::InsertSequenceFeatures::makeImmediateFeature('GUS::= Supported::Plugin::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'Bio::SeqFeature::Generic=3DHASH(0xab16364)', 37, 177) called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 750 GUS::Supported::Plugin::InsertSequenceFeatures::makeFeature('GUS::Supported= ::Plugin::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'Bio::SeqFeature::Generic=3DHASH(0xab16364)', 37, 177) called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 758 GUS::Supported::Plugin::InsertSequenceFeatures::makeFeature('GUS::Supported= ::Plugin::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'Bio::SeqFeature::Generic=3DHASH(0xabaf3ac)', 37, 177) called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 727 GUS::Supported::Plugin::InsertSequenceFeatures::processFeatureTrees('GUS::S= upported::Plugin::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'Bio::Seq::RichSeq=3DHASH(0xa95e35c)', 37, 177) called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 330 GUS::Supported::Plugin::InsertSequenceFeatures::run('GUS::Supported::Plugin= ::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'HASH(0xa49ac04)') called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 549 eval {...} called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 541 GUS::PluginMgr::GusApplication::doMajorMode_RunOrReport('GUS::PluginMgr::Gu= sApplication=3DHASH(0x9538c20)', 'GUS::Supported::Plugin::InsertSequenceFeatures', 1) called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 459 GUS::PluginMgr::GusApplication::doMajorMode_Run('GUS::PluginMgr::GusApplica= tion=3DHASH(0x9538c20)', 'GUS::Supported::Plugin::InsertSequenceFeatures') called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 357 GUS::PluginMgr::GusApplication::doMajorMode('GUS::PluginMgr::GusApplication= =3DHASH(0x9538c20)', 'GUS::Supported::Plugin::InsertSequenceFeatures') called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 266 GUS::PluginMgr::GusApplication::parseAndRun('GUS::PluginMgr::GusApplication= =3DHASH(0x9538c20)', 'ARRAY(0x954c728)') called at /GUS/gus_home/bin/ga line 11 Ricardo 2006/1/17, Angel Pizarro <an...@ma...>: > > Hi Ricardo, > > The error did not stem from my patch, but rather from another class that > failed to add the none-default columns to the version view objects. I > have edited a few files, so you will need to revert to current SVN > version of the repository for this patch to work: > <copy attached file to project home> > cd $PROJECT_HOME > svn revert GUS/DBAdmin > patch -p0 <DBAdmin.diff > > Then you should be able to rebuild GUS/DBAdmin and run dbaDump schema as > before. > > An example of the output view and rule follows > -angel > > > CREATE VIEW DoTSVer.AAFeatureVer AS > SELECT AA_FEATURE_ID, AA_SEQUENCE_ID, FEATURE_NAME_ID, PARENT_ID, > NA_FEATURE_ID, SUBCLASS_VIEW, SEQUENCE_ONTOLOGY_ID, DESCRIPTION, > PFAM_ENTRY_ID, MOTIF_AA_SEQUENCE_ID, REPEAT_TYPE_ID, > EXTERNAL_DATABASE_RELEASE_ID, SOURCE_ID, PREDICTION_ALGORITHM_ID, > IS_PREDICTED, REVIEW_STATUS_ID , MODIFICATION_DATE, USER_READ, > USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, > ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, > VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID FROM > DoTSVer.AAFeatureImpVer; > > CREATE RULE AAFeatureVer_32675 AS ON INSERT TO DoTSVer.AAFeatureVer DO > INSTEAD INSERT INTO DoTSVer.AAFeatureImpVer ( AA_FEATURE_ID, > AA_SEQUENCE_ID, FEATURE_NAME_ID, PARENT_ID, NA_FEATURE_ID, > SUBCLASS_VIEW, SEQUENCE_ONTOLOGY_ID, DESCRIPTION, PFAM_ENTRY_ID, > MOTIF_AA_SEQUENCE_ID, REPEAT_TYPE_ID, EXTERNAL_DATABASE_RELEASE_ID, > SOURCE_ID, PREDICTION_ALGORITHM_ID, IS_PREDICTED, REVIEW_STATUS_ID, > MODIFICATION_DATE, USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, > OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, > ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, > VERSION_TRANSACTION_ID ) VALUES ( new.AA_FEATURE_ID, new.AA_SEQUENCE_ID, > new.FEATURE_NAME_ID, new.PARENT_ID, new.NA_FEATURE_ID, > new.SUBCLASS_VIEW, new.SEQUENCE_ONTOLOGY_ID, new.DESCRIPTION, > new.PFAM_ENTRY_ID, new.MOTIF_AA_SEQUENCE_ID, new.REPEAT_TYPE_ID, > new.EXTERNAL_DATABASE_RELEASE_ID, new.SOURCE_ID, > new.PREDICTION_ALGORITHM_ID, new.IS_PREDICTED, new.REVIEW_STATUS_ID, > new.MODIFICATION_DATE, new.USER_READ, new.USER_WRITE, new.GROUP_READ, > new.GROUP_WRITE, new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, > new.ROW_GROUP_ID, new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, > new.VERSION_ALG_INVOCATION_ID, new.VERSION_DATE, > new.VERSION_TRANSACTION_ID ); > > Angel Pizarro wrote: > > > Yes, I have an idea of what is going on ... sloppy copy-paste coding > > on my part :( > > > > I'll add the other columns to the method and get you another patch. > > > > -angel > > > > > > Index: GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java (revision > 4068) > +++ GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java (working > copy) > @@ -48,6 +48,10 @@ > return column; > } > > + public void setColumns( ArrayList<ColumnPair> colpair) { > + column =3D colpair; > + } > + > public void addColumn( ColumnPair columnPair ) { > if ( !this.column.contains( columnPair ) ) { > this.column.add( columnPair ); > Index: GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > (revision 4068) > +++ GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > (working copy) > @@ -12,6 +12,7 @@ > import org.gusdb.dbadmin.model.GusSchema; > import org.gusdb.dbadmin.model.GusTable; > import org.gusdb.dbadmin.model.GusView; > +import org.gusdb.dbadmin.model.VersionView; > import org.gusdb.dbadmin.model.Schema; > import org.gusdb.dbadmin.model.Sequence; > import org.gusdb.dbadmin.model.Table; > @@ -105,6 +106,8 @@ > super.writeView( view ); > if ( view instanceof GusView ) { > writeViewRules( (GusView) view ); > + }else if ( view instanceof VersionView ) { > + writeVersionViewRules( (VersionView) view ); > } > } > > @@ -112,8 +115,6 @@ > * Since PostgreSQL doesn't support updatable views, this is a hack > that > * uses rules to mimick the updatable view functionality. > * > - * TODO: Note that this means version views are now not updatable > since they > - * don't have a PK. > * > * @param view DOCUMENT ME! > * @throws IOException DOCUMENT ME! > @@ -174,7 +175,47 @@ > oStream.flush( ); > } > > + > /** > + * Since PostgreSQL doesn't support updatable views, this is a hack > that > + * uses rules to mimick the updatable view functionality. > + * > + * Version views are now not updatable since they > + * don't have a PK, so we limit rules to insertion > + * > + * @param view DOCUMENT ME! > + * @throws IOException DOCUMENT ME! > + */ > + private void writeVersionViewRules( VersionView view ) throws > IOException { > + oStream.write( "CREATE RULE " + view.getName( ) + "_" + > random.nextInt( 100000 ) + " AS ON INSERT TO " > + + view.getSchema( ).getName( ) + "." + view.getName( ) + > " DO INSTEAD INSERT INTO " > + + view.getTable( ).getSchema( ).getName( ) + "." + > view.getTable( ).getName( ) + " ( " ); > + > + boolean first =3D true; > + for ( ColumnPair columnPair : view.getColumns() ) { > + if ( !first ) { > + oStream.write( ", " ); > + } > + oStream.write( columnPair.getTableName( ) ); > + first =3D false; > + } > + > + oStream.write( " ) VALUES ( " ); > + > + first =3D true; > + for ( ColumnPair columnPair : view.getColumns() ) { > + if ( !first ) { > + oStream.write( ", " ); > + } > + oStream.write( "new." + columnPair.getViewName( ) ); > + first =3D false; > + } > + > + oStream.write( " );\n\n" ); > + > + } > + > + /** > * DOCUMENT ME! > * > * @param type DOCUMENT ME! > Index: > GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.ja= va > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- > GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.ja= va > (revision 4068) > +++ > GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.ja= va > (working copy) > @@ -363,6 +363,9 @@ > superClassView.setVersioned( true ); > verSql =3D sql.concat( " " ); > > + // We need to add the superclass columns to the version view. > + superClassView.getVersionView( > ).setColumns((ArrayList<ColumnPair>) superClassView.getColumns().clone())= ; > + > for ( Column column : verHousekeepingColumns ) { > verSql =3D verSql.concat( ", " + column.getName( ) ); > superClassView.getVersionView( ).addColumn( new > ColumnPair( column.getName( ), column.getName( ) ) ); > @@ -448,7 +451,8 @@ > if ( impTable.isVersioned( ) ) { > subClass.setVersioned( true ); > verSql =3D sql.concat( " " ); > - > + // We need to add the subclass_view's columns > + subClass.getVersionView( ).setColumns((ArrayList<ColumnPair>) > subClass.getColumns().clone()); > for ( Column column : verHousekeepingColumns ) { > verSql =3D verSql.concat( ", " + column.getName( ) ); > subClass.getVersionView( ).addColumn( new ColumnPair( > column.getName( ), column.getName( ) ) ); > > > |