Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

23
LINES

< > BotCompany Repo | #1007484 // shutDownDB - shut down a remote DB

JavaX fragment (include)

1  
// returns true if DB was running
2  
static bool shutDownDB(S dbID) {
3  
  RemoteDB db = connectToDBOpt(dbID);
4  
  if (db != null) {
5  
    print("Shutting down DB " + dbID + "...");
6  
    try {
7  
      db.xshutdown();
8  
    } catch e {
9  
      print("Possibly OK: " + exceptionToStringShort(e));
10  
    }
11  
    db.close();
12  
    if (dbRunning(dbID)) {
13  
      sleepSeconds(5);
14  
      if (dbRunning(dbID))
15  
        fail("Could not should down DB " + dbID);
16  
    }
17  
    print("DB shut down.");
18  
    true;
19  
  } else {
20  
    print("DB not running.");
21  
    false;
22  
  }
23  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007484
Snippet name: shutDownDB - shut down a remote DB
Eternal ID of this version: #1007484/3
Text MD5: 1bff1b5a0135ccb5b9b6092988638b11
Author: stefan
Category: javax / concepts / rpc
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-24 14:59:51
Source code size: 550 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 498 / 501
Version history: 2 change(s)
Referenced in: [show references]