Re: [DB4O] Locking, gleichzeitiger Lesezugriff aus zwei VMs



blackdrag@xxxxxx said...

wenn du 2x einen Server startest, der die gleiche Datei benutzen soll...
kein Wunder würde ich behaupten. Erstmal musst du einen Benutzer
einrichten, und dann als Client verbinden.

Nunja, ich hatte naiv gedacht, dass DB4O selbst erkennt, ob schon ein
Server läuft..

Client 1:

ObjectServer server = Db4o.openServer(DB_FILENAME, 12045);
server.grantAccess("Wanja","Gayk")
db = server.openClient()

Client 2:

db = Db4o.openClient("localhost",12045,"Wanja","Gayk")

so in der Art zumindest. Siehe auch Docu ;)

Ich werde wohlnoch mal unter CLient/Server nachschlagen müssen.. auf
den Trichter bin ich eben ja noch nicht gekommen.
Danke für den Hinweis.

autsch... mit den native queries kenne ich mich nicht aus. Allerdings:

Exception in thread "AWT-EventQueue-0"
com.db4o.ext.ObjectNotStorableException: Add constructor that won't
throw exceptions, configure constructor calls, or provide a translator
to class 'java.lang.Object' and make sure the class is deployed to the
server with the same package/namespace + assembly name.

sagt die Meldung doch viel. Hilft das nciht weiter?

Nö. Eigentlich hilft die mir überhaupt nicht. Weder war klar welches
Objekt gemeint war, noch hatte ich einen Kontruktor der Exceptions
schmeißt.

[...]
Und das ganze findet in meinem Program hier statt:


<T> List<T> query(final Predicate<T> predicate){
if(predicate == null){
throw new IllegalArgumentException("predicate is null");
}
final List<T> result;
synchronized(dbLock){
result = db.query(predicate); //<--- !! Boom!
}
assert result != null : "query returned null instead of an empty list";
return result
}

Nun steh' ich endgültig im Wald....

hast du es mal ohne die IllegalArgumentException versucht? Ohne assert
am besten auch gleich... und überhaupt... wie soll diese Querie denn
nach Soda abgebildet werden? ;) ausserdem scheint mir dein query im
query äusserst ungesund zu sein

Das ist keine Query in Query, sondern was du dort siehst ist lediglich
eine Methode, die ein Predcate erwartet und dieses der dem
Objektcontainer weitergibt.
Das ist praktische das Gleiche,als würde ich schreiben:

result = db.query(new Predicate<T>(){
//bla
});

Nur dass das Predicate eben nicht in dieser Klasse erzeugt wird, sondern
in einer anderen (der die die Queries implementiert).

Gruß,
-Wanja-

--
Die "Difference Engine" ist ein Muster für Forschung und Entwicklung in
England: Sie war ihrer Zeit weit voraus. Ihr Nachfolger, die "Analytical
Engine", ist ein noch viel größeres Vorbild für die britische
Entwicklung: Sie wurde überhaupt nie gebaut.
.



Relevant Pages

  • Re: High CPU in client (Excel, OWC, Proclarity, etc.) accessing Analysis Services
    ... We have encountered similar problems not limited to Excel, but every client. ... occur when there are many dimensions nested on each other on a single axis ... > Performance Guide to optimize the query, the cube, the server, etc. ... > While the query was grinding, the server was doing absolutely nothing. ...
    (microsoft.public.sqlserver.olap)
  • RE: LDAP query for xerox 3545 printer/scanner blocked by SBS 2003?
    ... Client and printer pointing to SBS for DNS ... LDP query from another workstation was successful ... Step2:Please ensure the DNS on workstation is pointed to SBS server. ... Monitor will capture some packets which pass through this interface. ...
    (microsoft.public.windows.server.sbs)
  • Re: public distributed filesystem
    ... You have a simple server which keeps track of client ... >>whether a peer has honestly kept your data block ... respond to any checksum query is to essentially store ...
    (comp.os.linux.misc)
  • Re: Parameterized Query
    ... The only point for a parameter, client side, is the where clause and you ... benefit from execution cache plans on a server like SQL Server. ... if the sql in the sproc is fully qualified. ... Assembling the query, client or server side, will take very few cycles. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: VLDM Slow performance on Client PC
    ... from the server to the client. ... you can force the execution of the query on the server side rather the ... it creates another system process to hold the dimension in memory. ...
    (microsoft.public.sqlserver.olap)

Loading