Atomikos Forum

race condition while enlisting xaResource

Hi,
below is the code which I think produces race condition:
 
        synchronized ( Configuration.class ) {
                // synchronized to avoid case 61740
                
                ret = new TemporaryXATransactionalResource(xares);
                // cf case 61740: check for concurrent additions before this synch block was entered
                if ( Configuration.getResource ( ret.getName() ) == null ) {
                    if(LOGGER.isDebugEnabled()){
                        LOGGER.logDebug("constructing new temporary resource "
                                + "for unknown XAResource: " + xares);
                    }
                    Configuration.addResource ( ret );
                }
    }

There should be an else block

    else {
        ret = Configuration.getResource ( ret.getName() );
    }
Ali Gurbuz Send private email
Tuesday, February 04, 2014
 
 
Thank you,

created a bug report to fix in an upcoming release.
Guy Pardon Send private email
Monday, February 10, 2014
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics