fix: set READ_WRITE as default database mode
choose to set or not: ONLY_READ in Util.h if used as sparql endpoint, set it to save memory; otherwise, not set it to support insert/delete; by zengli
This commit is contained in:
parent
61a28de125
commit
17e0ff2b46
|
@ -26,6 +26,9 @@ void default_resource_send(const HttpServer &server, const shared_ptr<HttpServer
|
|||
Database *current_database = NULL;
|
||||
int connection_num = 0;
|
||||
|
||||
//DEBUG+TODO: why the result transfered to client has no \n \t??
|
||||
//using json is a good way to avoid this problem
|
||||
|
||||
//TODO+BETTER: port should be optional
|
||||
//1. admin.html: build/load/query/unload
|
||||
//2. index.html: only query (maybe load/unload if using multiple databases)
|
||||
|
|
|
@ -109,7 +109,7 @@ in the sparql query can point to the same node in data graph)
|
|||
//===================================================================================================================
|
||||
|
||||
//if used as only-read application(like sparql endpoint)
|
||||
#define ONLY_READ 1
|
||||
//#define ONLY_READ 1
|
||||
//if use pthread and lock
|
||||
#define THREAD_ON 1
|
||||
//if use stream module if result is too large than memory can hold
|
||||
|
|
|
@ -39,6 +39,10 @@ public class JavaAPIExample
|
|||
|
||||
// also, you can load some exist database directly and then query.
|
||||
gc.load("LUBM10");
|
||||
//sparql = "delete where "
|
||||
//+ "{"
|
||||
//+ "<http://www.founder/121> ?predicate ?object ."
|
||||
//+ "}";
|
||||
answer = gc.query(sparql);
|
||||
System.out.println(answer);
|
||||
gc.unload("LUBM10");
|
||||
|
|
8
makefile
8
makefile
|
@ -43,11 +43,11 @@ CC = ccache g++
|
|||
#NOTICE: -O2 is recommended, while -O3 is dangerous
|
||||
#when developing, not use -O because it will disturb the normal
|
||||
#routine. use it for test and release.
|
||||
CFLAGS = -c -Wall -O2 -pthread -std=c++11
|
||||
EXEFLAG = -O2 -pthread -std=c++11
|
||||
#CFLAGS = -c -Wall -O2 -pthread -std=c++11
|
||||
#EXEFLAG = -O2 -pthread -std=c++11
|
||||
#-coverage
|
||||
#CFLAGS = -c -Wall -O2 -pthread -g
|
||||
#EXEFLAG = -O2 -pthread -g
|
||||
CFLAGS = -c -Wall -pthread -g -std=c++11
|
||||
EXEFLAG = -pthread -g -std=c++11
|
||||
|
||||
#add -lreadline -ltermcap if using readline or objs contain readline
|
||||
library = -ltermcap -lreadline -L./lib -L/usr/local/lib -lantlr -lgcov -lboost_filesystem -lboost_system -lboost_regex -lpthread -I/usr/local/include/boost
|
||||
|
|
Loading…
Reference in New Issue