In the meantime, I figured out the following:
- In 1.5.2 in WriteTransaction's propIndexRecords member has been
declared and initialized like this:
private final Map<Integer,PropertyIndexRecord> propIndexRecords =
new HashMap<Integer,PropertyIndexRecord>();
- In 1.6.2, however, it is declared but is not initialized at
construction time:
private Map<Integer,PropertyIndexRecord> propIndexRecords;
Although I don't know what 'propIndexRecords' is for but if it not
initialized somewhere in the 1.6.2 WriteTransaction implementation then
it will be definitely null in
PropertyIndexRecord getPropertyIndexRecord( int id )
{
return propIndexRecords.get( id );
}
So, the hack I tried is this in 1.6.2:
PropertyIndexRecord getPropertyIndexRecord( int id )
{
if (propIndexRecords == null) {
return null;
}
return propIndexRecords.get( id );
}
And now it seems to work for me as is did in 1.5.2 and earlier. It maybe
OK to return null here, since getPropertyIndexRecord() is invoked from
WriteTransaction#loadIndex() like this:
@Override
public String loadIndex( int id )
{
PropertyIndexStore indexStore = getPropertyStore().getIndexStore();
PropertyIndexRecord index = getPropertyIndexRecord( id );
if ( index == null )
{
index = indexStore.getRecord( id );
}
if ( index.isLight() )
{
indexStore.makeHeavy( index );
}
return indexStore.getStringFor( index );
}
If getPropertyIndexRecord() returns null, then indexStore.getRecord()
will create the index, as far as I understand.
But still, these are only my guesses and would be glad to have some
neo4j kernel expert to help me out. :-)
Best regards,
---
balazs