1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-05 23:22:47 +00:00

Fixed issue at character creation and OrientDB selectIDs query issue

This commit is contained in:
2011-12-26 14:03:21 -02:00
parent b017ba5e71
commit d72a28f616
15 changed files with 29 additions and 17 deletions

View File

@@ -72,7 +72,7 @@ public class BitSetIDAllocator implements IDAllocator {
@Override
public void allocate(int id) {
if (ids.get(id - FIRST_ID))
throw new IDAllocatorException("ID not allocated");
throw new IDAllocatorException("ID already allocated");
log.debug("Allocating ID {}", id);
lock.lock();
try {

View File

@@ -63,6 +63,7 @@ import com.mysema.query.sql.RelationalPathBase;
import com.mysema.query.types.Path;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentPool;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OClass.INDEX_TYPE;
import com.orientechnologies.orient.core.metadata.schema.OProperty;
@@ -214,7 +215,6 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
database = new ODatabaseDocumentTx(config.getUrl());
if (!database.exists()) {
database.create();
}
}
// database.getStorage().addUser();
@@ -260,6 +260,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
final ODatabaseDocumentTx database = ODatabaseDocumentPool.global()
.acquire(config.getUrl(), config.getUsername(),
config.getPassword());
database.declareIntent(new OIntentMassiveInsert());
transaction.set(database);
try {
database.begin(OTransaction.TXTYPE.OPTIMISTIC);
@@ -274,6 +275,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
throw new DatabaseException(e);
} finally {
transaction.set(null);
database.declareIntent(null);
database.close();
}
}