final ORecordSerializationContext context = ORecordSerializationContext.getContext();
if (context != null) {
if (delegate.size() >= topThreshold && isEmbedded()
&& ODatabaseRecordThreadLocal.INSTANCE.get().getSbTreeCollectionManager() != null) {
ORidBagDelegate oldDelegate = delegate;
delegate = new OSBTreeRidBag();
boolean oldAutoConvert = oldDelegate.isAutoConvertToRecord();
oldDelegate.setAutoConvertToRecord(false);
for (OIdentifiable identifiable : oldDelegate)
delegate.add(identifiable);