On Fri, Jul 29, 2016 at 3:43 AM, <[email protected]> wrote:

> On Thursday, May 19, 2016 01:33:11 PM Bert Massop wrote:
> > On Thu, May 19, 2016 at 1:04 PM, Moses <[email protected]> wrote:
> > > (plugins.WebOfTrust.WebOfTrust, <noname>(51), ERROR): Error during
> startup
> > > com.db4o.ext.Db4oIOException
> > >
> > >     at
> > >
>  com.db4o.io.CachedIoAdapter.validateReadOnly(CachedIoAdapter.java:244
> > >     )
> > >     at com.db4o.io.CachedIoAdapter.write(CachedIoAdapter.java:215)
> > >     at com.db4o.internal.PersistentBase.write(PersistentBase.java:171)
> > >     [...]
> > >     at
> > >
>  com.db4o.internal.LocalObjectContainer.createBTreeClassIndex(LocalObj
> > >     ectContainer.java:149) at
> > >
>  com.db4o.internal.classindex.BTreeClassIndexStrategy.createBTreeIndex
> > >     (BTreeClassIndexStrategy.java:78) [...]
> > >     at com.db4o.internal.ClassMetadata.init(ClassMetadata.java:983)
> > >     [...]
> > >     at
> > >
>  com.db4o.internal.query.processor.QQueryBase.addClassConstraint(QQuer
> > >     yBase.java:190) at
> > >
>  com.db4o.internal.query.processor.QQueryBase.constrain(QQueryBase.jav
> > >     a:129) at
> > >
>  plugins.WebOfTrust.WebOfTrust.peekDatabaseFormatVersion(WebOfTrust.ja
> > >     va:1468) at
> > >     plugins.WebOfTrust.WebOfTrust.openDatabase(WebOfTrust.java:630)
> [...]
> >
> > This looks simple to me. `peekDatabaseFormatVersion` opens the
> > database with a read-only configuration obtained through
> > `getNewDatabaseConfiguration(true)`, however the latter configures
> > indexes regardless of the read-only flag. When adding a constraint
> > (line 1468) Db4o then attempts to initialize these indexes
> > (`createBTreeIndex` and friends). In this initialization, Db4o tries
> > to write, and the read-only configured CachedIoAdapter bails out.
> >
> > Long story short: don't attempt to configure indexes on read-only
> > databases ;-) Should be an easy fix.
>
> I did the following procedure (with build0018):
> 1. Comment out all index creation code in getNewDatabaseConfiguration()
> 2. Start WoT to create a fresh database without any indexes, create an own
> identity, stop it.
>

This assumes that class indexes are off by default. AFAIK by default they
are on. If my assumptions are right, this can be triggered by explicitly
disabling the class index for the Configuration class, creating a database,
re-enabling indexes, and then querying for Configuration in read-only mode.


> 3. Re-enable the index creation code. Start WoT again to make the
> peekDatabaseFormatVersion() hit the database which has no indexes.
> db4o now should have tried to create them as you suspected.
> If what you suspected was right, this should have reprocuded the error -
> but
> it did not :(
>
> Any other ideas?
>
> If not,  I would suspect the affected database was just randomly broken :|
>

It may indeed be a broken (or incomplete) database, an old database from
some era where class indexes were not around (if that ever was the case),
or another random failure.
In my opinion a missing class index would be an error, for it would prevent
Query.constrain(Class) to work with reasonable efficiency. Still, or should
not lead to WoT failing to start.
_______________________________________________
Devl mailing list
[email protected]
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to