8000 Fixed #136 · githubcs/baasbox@0c0d538 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c0d538

Browse files
committed
Fixed baasbox#136
1 parent cac8757 commit 0c0d538

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

app/com/baasbox/db/DbHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public static void shutdownDB(boolean repopulate){
224224

225225
try{
226226
//WE GET THE CONNECTION BEFORE SETTING THE SEMAPHORE
227-
db = DbHelper.open( BBConfiguration.getAPPCODE(),"admin", "admin");
227+
db = getConnection() 8000 ;
228228

229229
synchronized(DbHelper.class) {
230230
if(!dbFreeze.get()){
@@ -295,7 +295,7 @@ public static OGraphDatabase reconnectAsAuthenticatedUser (){
295295
public static void close(OGraphDatabase db) {
296296
Logger.debug("closing connection");
297297
if (db!=null && !db.isClosed()){
298-
HooksManager.unregisteredAll(db);
298+
//HooksManager.unregisteredAll(db);
299299
db.close();
300300
}else Logger.debug("connection already close or null");
301301
}
@@ -507,8 +507,8 @@ public void onMessage(String m) {
507507
Logger.info("...setting up internal user credential...");
508508
updateDefaultUsers();
509509
Logger.info("...registering hooks...");
510-
HooksManager.registerAll(db);
511510
evolveDB(db);
511+
HooksManager.registerAll(db);
512512
}catch(Exception ioe){
513513
Logger.error("*** Error importing the db: ", ioe);
514514
throw new UnableToImportDbException(ioe);

app/com/baasbox/db/hook/HooksManager.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@
1818

1919

2020
import java.util.Iterator;
21+
import java.util.List;
2122
import java.util.Set;
2223

24+
import org.apache.commons.collections.IteratorUtils;
25+
2326
import play.Logger;
2427

2528
import com.orientechnologies.orient.core.db.graph.OGraphDatabase;
2629
import com.orientechnologies.orient.core.hook.ORecordHook;
2730
import com.orientechnologies.orient.core.hook.ORecordHook.HOOK_POSITION;
2831

29-
public class HooksManager {
32+
public class HooksManager {
3033
public static void registerAll(OGraphDatabase db){
3134
Logger.trace("Method Start");
3235
Logger.debug("Registering hooks...");
@@ -53,18 +56,19 @@ public static void registerAll(OGraphDatabase db){
5356
public static void unregisteredAll(OGraphDatabase db){
5457

5558
Logger.trace("Method Start");
56-
/*
59+
5760
Logger.debug("unregistering hooks...");
5861
Set<ORecordHook> hooks = db.getHooks();
59-
Iterator<ORecordHook> it =hooks.iterator();
62+
List hs = IteratorUtils.toList(hooks.iterator());
63+
Iterator<ORecordHook> it =hs.iterator();
6064
while (it.hasNext()){
6165
ORecordHook h = it.next();
6266
if (h instanceof BaasBoxHook) {
6367
Logger.debug("Removing "+ ((BaasBoxHook) h).getHookName() + " hook");
6468
db.unregisterHook(h);
6569
}
6670
}
67-
*/
71+
6872
Logger.trace("Method End");
6973

7074
}

project/Build.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ object ApplicationBuild extends Build {
1313
javaCore,filters,
1414
"commons-io" % "commons-io" % "2.4",
1515
"commons-lang" % "commons-lang" % "2.6",
16+
"commons-collections" % "commons-collections" % "3.2",
1617
"xalan" % "xalan" % "2.7.1",
1718
"org.imgscalr" % "imgscalr-lib" % "4.2",
1819
"org.apache.commons" % "commons-email" % "1.3.1",

0 commit comments

Comments
 (0)
0