Buggy code:
public class OHazelcastPlugin extends ODistributedAbstractPlugin implements OCommandOutputListener , EntryListener < String , Object > , MembershipListener { protected static final String NODE_NAME_ENV = "ORIENTDB_NODE_NAME" ; protected static final String CONFIG_NODE_PREFIX = "node." ; protected static final String CONFIG_DBSTATUS_PREFIX = "dbstatus." ; protected static final String CONFIG_DATABASE_PREFIX = "database." ; protected static final String BACKUP_DIR = "..//backup//databases" ; protected String nodeId ; protected String hazelcastConfigFile = "hazelcast.xml" ; protected Map < String , Member > activeNodes = new ConcurrentHashMap < String , Member > ( ) ; protected OHazelcastDistributedMessageService messageService ; protected long timeOffset = 0 ; protected Date startedOn = new Date ( ) ; protected volatile NODE_STATUS status = NODE_STATUS . OFFLINE ; protected String membershipListenerRegistration ; protected volatile HazelcastInstance hazelcastInstance ; protected Object installDatabaseLock = new Object ( ) ; protected long lastClusterChangeOn ; protected List < ODistributedLifecycleListener > listeners = new ArrayList < ODistributedLifecycleListener > ( ) ; public OHazelcastPlugin ( ) { } @ Override public void config ( final OServer iServer , final OServerParameterConfiguration [ ] iParams ) { } @ Override public void startup ( ) { } @ Override public long getDistributedTime ( final long iTime ) { } @ Override public void sendShutdown ( ) { } @ Override public void shutdown ( ) { } @ Override public ODocument getClusterConfiguration ( ) { } public ODocument getNodeConfigurationById ( final String iNodeId ) { } @ Override public ODocument getLocalNodeConfiguration ( ) { } public boolean isEnabled ( ) { } public NODE_STATUS getNodeStatus ( ) { } @ Override public void setNodeStatus ( final NODE_STATUS iStatus ) { } public boolean checkNodeStatus ( final NODE_STATUS iStatus2Check ) { } @ Override public DB_STATUS getDatabaseStatus ( final String iNode , final String iDatabaseName ) { } @ Override public void setDatabaseStatus ( final String iNode , final String iDatabaseName , final DB_STATUS iStatus ) { } @ Override public Object sendRequest ( final String iDatabaseName , final Collection < String > iClusterNames , final Collection < String > iTargetNodes , final OAbstractRemoteTask iTask , final EXECUTION_MODE iExecutionMode ) { checkForClusterRebalance ( iDatabaseName ) ; final OHazelcastDistributedRequest req = new OHazelcastDistributedRequest ( getLocalNodeName ( ) , iDatabaseName , iTask , iExecutionMode ) ; final ODatabaseDocument currentDatabase = INSTANCE . getIfDefined ( ) ; if ( ( currentDatabase != null ) && ( ( currentDatabase . getUser ( ) ) != null ) ) <START_BUG> req . setUserName ( currentDatabase . getUser ( ) . getName ( ) ) ; <END_BUG> final OHazelcastDistributedDatabase db = messageService . getDatabase ( iDatabaseName ) ; if ( ( iTargetNodes == null ) || ( iTargetNodes . isEmpty ( ) ) ) { ODistributedServerLog . error ( this , getLocalNodeName ( ) , null , OUT , "No<seq2seq4repair_space>nodes<seq2seq4repair_space>configured<seq2seq4repair_space>for<seq2seq4repair_space>partition<seq2seq4repair_space>'%s.%s'<seq2seq4repair_space>request:<seq2seq4repair_space>%s" , iDatabaseName , iClusterNames , req ) ; throw new ODistributedException ( ( ( ( ( ( "No<seq2seq4repair_space>nodes<seq2seq4repair_space>configured<seq2seq4repair_space>for<seq2seq4repair_space>partition<seq2seq4repair_space>'" + iDatabaseName ) + "." ) + iClusterNames ) + "'<seq2seq4repair_space>request:<seq2seq4repair_space>" ) + req ) ) ; } final ODistributedResponse response = db . send2Nodes ( req , iClusterNames , iTargetNodes , iExecutionMode ) ; if ( response != null ) return response . getPayload ( ) ; return null ; } public Set < String > getManagedDatabases ( ) { } public String getLocalNodeName ( ) { } @ Override public String getLocalNodeId ( ) { } @ Override public void onCreate ( final ODatabaseInternal iDatabase ) { } @ Override public void onOpen ( final ODatabaseInternal iDatabase ) { } @ Override public void onCreateClass ( final ODatabaseInternal iDatabase , final OClass iClass ) { } @ Override public void onDropClass ( ODatabaseInternal iDatabase , OClass iClass ) { } @ SuppressWarnings ( "unchecked" ) public ODocument getStats ( ) { } public String getNodeName ( final Member iMember ) { } public Set < String > getRemoteNodeIds ( ) { } @ Override public void memberAdded ( final MembershipEvent iEvent ) { } @ Override public void updateLastClusterChange ( ) { } @ Override public void memberRemoved ( final MembershipEvent iEvent ) { } @ Override public void memberAttributeChanged ( MemberAttributeEvent memberAttributeEvent ) { } @ Override public void entryAdded ( final EntryEvent < String , Object > iEvent ) { } @ Override public void entryUpdated ( final EntryEvent < String , Object > iEvent ) { } @ Override public void entryRemoved ( final EntryEvent < String , Object > iEvent ) { } @ Override public void entryEvicted ( EntryEvent < String , Object > iEvent ) { } @ Override public void mapEvicted ( MapEvent event ) { } @ Override public void mapCleared ( MapEvent event ) { } @ Override public boolean isNodeAvailable ( final String iNodeName , final String iDatabaseName ) { } public boolean isOffline ( ) { } public void waitUntilOnline ( ) throws InterruptedException { } public HazelcastInstance getHazelcastInstance ( ) { } public Lock getLock ( final String iName ) { } @ Override public String toString ( ) { } public Serializable executeOnLocalNode ( final ODistributedRequest req , final ODatabaseDocumentTx database ) { } @ Override public OHazelcastDistributedMessageService getMessageService ( ) { } public void updateCachedDatabaseConfiguration ( String iDatabaseName , ODocument cfg , boolean iSaveToDisk , boolean iDeployToCluster ) { } public long getLastClusterChangeOn ( ) { } @ Override public void onMessage ( String iText ) { } public int getAvailableNodes ( final String iDatabaseName ) { } @ Override public Map < String , Object > getConfigurationMap ( ) { } public boolean installDatabase ( boolean iStartup , String databaseName , ODocument config ) { } @ Override public void propagateSchemaChanges ( final ODatabaseInternal iDatabase ) { } public synchronized void installClustersOfClass ( final ODatabaseInternal iDatabase , final ODistributedConfiguration cfg , final OClass iClass ) { } protected void checkDatabaseEvent ( final EntryEvent < String , Object > iEvent , final String databaseName ) { } protected boolean installDbClustersForLocalNode ( final ODatabaseInternal iDatabase , final ODistributedConfiguration cfg ) { }

Fix:
req . setUserRID ( currentDatabase . getUser ( ) . getIdentity ( ) . getIdentity ( ) ) ;