Changeset 5736
- Timestamp:
- Sep 14, 2011, 2:32:46 PM (11 years ago)
- Location:
- trunk/src/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/common-queries.xml
r5734 r5736 3338 3338 </description> 3339 3339 </query> 3340 3340 3341 <query id="DISABLE_ALL_PLUGINS" type="HQL"> 3342 <sql> 3343 UPDATE PluginDefinitionData pl 3344 SET pl.disabled = true 3345 </sql> 3346 <description> 3347 A Hibernate query that disable all plug-ins. 3348 </description> 3349 </query> 3350 3341 3351 3342 3352 </predefined-queries> -
trunk/src/core/net/sf/basedb/core/Update.java
r5734 r5736 50 50 import net.sf.basedb.core.data.ItemSubtypeData; 51 51 import net.sf.basedb.core.data.PhysicalBioAssayData; 52 import net.sf.basedb.core.data.PluginDefinitionData;53 52 import net.sf.basedb.core.data.ProjectKeyData; 54 53 import net.sf.basedb.core.data.PropertyFilterData; … … 335 334 session.delete(tmpType); 336 335 337 // Disable the 'BioAssaySetExporter' plug-in since it is no longer included in the code338 query = HibernateUtil.getPredefinedQuery(session, "GET_PLUGINDEFINITION_FOR_CLASSNAME");339 query.setString("className", "net.sf.basedb.plugins.BioAssaySetExporter");340 PluginDefinitionData plugin = HibernateUtil.loadData(PluginDefinitionData.class, query);341 if (plugin != null)342 {343 plugin.setDisabled(true);344 }345 346 336 // Update the schema version number 347 337 setSchemaVersion(session, schemaVersion); … … 458 448 removeContext(session, FILETYPE); 459 449 450 progress.display(65, "--Disabling all plug-ins"); 451 disablePlugins(session); 452 460 453 // 2: remove unused columns/tables 461 454 progress.display(80, "--Dropping old database objects"); … … 656 649 throw ex; 657 650 } 651 } 652 653 private static void disablePlugins(org.hibernate.Session session) 654 { 655 org.hibernate.Transaction tx = null; 656 org.hibernate.Query query = null; 657 try 658 { 659 log.debug("Disabling all plug-ins"); 660 tx = HibernateUtil.newTransaction(session); 661 662 // Disable all plug-ins 663 query = HibernateUtil.getPredefinedQuery(session, "DISABLE_ALL_PLUGINS"); 664 query.executeUpdate(); 665 HibernateUtil.commit(tx); 666 } 667 catch (BaseException ex) 668 { 669 if (tx != null) HibernateUtil.rollback(tx); 670 throw ex; 671 } 672 658 673 } 659 674
Note: See TracChangeset
for help on using the changeset viewer.