Sincronized getInstance() method and fixed error message
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-aggregator-se-plugin@154565 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3d6c113185
commit
81ee077a94
|
@ -85,7 +85,7 @@ public class CouchBaseConnector {
|
|||
protected Map<String,Bucket> connectionMap;
|
||||
protected Map<String, Class<? extends Record>> recordTypeMap;
|
||||
|
||||
public static CouchBaseConnector getInstance() throws Exception{
|
||||
public synchronized static CouchBaseConnector getInstance() throws Exception{
|
||||
if(couchBaseConnector==null){
|
||||
couchBaseConnector = new CouchBaseConnector();
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ public class CouchBaseConnector {
|
|||
List<N1qlQueryRow> rows = result.allRows();
|
||||
|
||||
if(rows.size()>1){
|
||||
String error = String.format("More than one Document found for query %. This is really strange and should not occur. Please contact the Administrator.", statement.toString());
|
||||
String error = String.format("More than one Document found for query %s. This is really strange and should not occur. Please contact the Administrator.", statement.toString());
|
||||
logger.error(error);
|
||||
throw new Exception(error);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue