Closed GoogleCodeExporter closed 9 years ago
This is not possible since the scope of the decoder is just for the query, not
the Mongo instance as you suggest.
Original comment by scotthernandez
on 2 Feb 2012 at 1:41
Won't this work:
if (this.ds.getDecoderFact() != this.ds.getMongo().getMongoOptions().dbDecoderFactory) {
cursor.setDecoderFactory( this.ds.getDecoderFact() );
}
Original comment by jeff.ye...@gmail.com
on 2 Feb 2012 at 2:56
Yep... we could even do that in the driver :) ... on the set method.
Original comment by scotthernandez
on 2 Feb 2012 at 3:08
Definitely, it can and should be fixed in the driver, but may not be in the
2.7.x line.
Original comment by jeff.ye...@gmail.com
on 2 Feb 2012 at 3:18
FYI, DatastoreImpl.java:
public DBDecoderFactory getDecoderFact() { return decoderFactory != null ?
decoderFactory : mongo.getMongoOptions().dbDecoderFactory; }
And at some point this may be exposed in Morphia but for now it is just there
because I was testing the lazy decoding in some tests and needed to be able to
change it for a few Datastore instances in the test where I din't want to use
the default set. In practice nobody sets a custom decoder via morphia except in
those tests.
Original comment by scotthernandez
on 2 Feb 2012 at 5:27
Original issue reported on code.google.com by
jeff.ye...@gmail.com
on 2 Feb 2012 at 1:37