I am developing a simple Storage Extension for Tridion Docs. In the extension code I have a class that is using LocalThreadTransaction
class from the namespace com.tridion.storage.services.LocalThreadTransaction
the same way as SI4T class TridionBaseItemProcessor.
The issue is LocalThreadTransaction.getTransactionId()
always returns as Null. Any idea what could be wrong with my code?
import com.tridion.storage.extension.models.RestRecord;
import com.tridion.storage.services.LocalThreadTransaction;
import org.slf4j.Logger;
public class SBXItemProcessor {
public static void addSBXItem(int pubId, RestRecord.operation opr, Logger log)
{
log.info("Adding publication:" + pubId + ", for action: " + opr.toString());
RestRecord record = new RestRecord(pubId, opr);
SBXIndexProcessor.registerAction(LocalThreadTransaction.getTransactionId(), record);
}
}
Update:
As answered here, I tried LocalThreadTransaction.get()
inside a DAO but it returns null there as well.