The log tells me that when ecB.objectsWithFetchSpecification is executed, ecA is locked. And it's locked forever. I wasn't sure to have to use a localInstance of customer because I use it only to create a qualifier. But I did the test and it's worth.
ecA and ecB are locked automatically and never unlocked.
I found a solution, that's to lock/unlock both editingContexts but I'm unsatisfied because I don't understand why EOUtilities.localInstance locks ecA and ecB and doesn't unlock them. Naturally I would find the good way to use it.
Outstanding at @Thread[Thread-4,5,main]
java.lang.Exception: Locked
at er.extensions.eof.ERXEC.traceLock(ERXEC.java:532)
at er.extensions.eof.ERXEC.lock(ERXEC.java:502)
at er.extensions.eof.ERXEC.autoLock(ERXEC.java:627)
at er.extensions.eof.ERXEC.globalIDForObject(ERXEC.java:844)
at com.webobjects.eoaccess.EODatabaseContext._globalIDForObject(EODatabaseContext.java:4644)
at com.webobjects.eoaccess.EODatabaseContext.databaseOperationForObject(EODatabaseContext.java:4767)
at com.webobjects.eoaccess.EODatabaseContext.valuesForKeys(EODatabaseContext.java:6535)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.valuesForKeys(EOObjectStoreCoordinator.java:326)
at com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:439)
at er.extensions.ERXExtensions$KeyValueQualifierSQLGenerationSupport.schemaBasedQualifierWithRootEntity(ERXExtensions.java:333)
at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:179)
at com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:530)
at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:179)
at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:227)
at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055)
at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1211)
at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4444)
at fr.sophiacom.ynp.push.BigObjectB.fetchesInvoice(BigObjectB.java:238)
at fr.sophiacom.BigObjectB._run(BigObjectB.java:110)
at er.extensions.concurrency.ERXRunnable.run(ERXRunnable.java:23)
at java.lang.Thread.run(Thread.java:637)