public void dropPackage(DropPackageRequest request) {
    boolean success = false;
    try {
      openTransaction();
      MPackage proc = findMPackage(request.getCatName(), request.getDbName(), request.getPackageName());
      pm.retrieve(proc);
      if (proc != null) {
        pm.deletePersistentAll(proc);
      }
      success = commitTransaction();
    } finally {
      if (!success) {
        rollbackTransaction();
      }
    }
  }
@Test
  public void testDropPackage() throws Exception {
    objectStore.createDatabase(new DatabaseBuilder()
            .setName(DB1)
            .setDescription("description")
            .setLocation("locationurl")
            .build(conf));
    AddPackageRequest pkg = new AddPackageRequest("hive", DB1, "pkg1", "user1", "header", "body");
    objectStore.addPackage(pkg);
    Assert.assertNotNull(objectStore.findPackage(new GetPackageRequest("hive", DB1, "pkg1")));
    objectStore.dropPackage(new DropPackageRequest("hive", DB1, "pkg1"));
    Assert.assertNull(objectStore.findPackage(new GetPackageRequest("hive", DB1, "pkg1")));
  }