Community
Participate
Working Groups
My application run whith GlassFish 4.1 and start's very fast, but if you call many searchs the speed decrase to very slow quickly... The HEAPDUMP showme the class org.eclipse.persistence.internal.queries.AttributeItem and class org.eclipse.persistence.internal.helper.NonSynchronizedVector increase to stratospheric number, see: 440596 instances of class org.eclipse.persistence.internal.queries.AttributeItem 322771 instances of class org.eclipse.persistence.internal.helper.NonSynchronizedVector 248445 instances of class org.eclipse.persistence.internal.helper.DatabaseField 230745 instances of class org.eclipse.persistence.internal.descriptors.PersistenceObjectAttributeAccessor 184137 instances of class org.eclipse.persistence.mappings.DirectToFieldMapping I'm using EclipseLink with Multitenant feature : @Entity @Table(name = "asdasd", catalog = "aaaa", schema = "") @XmlRootElement @Multitenant(MultitenantType.TABLE_PER_TENANT) @TenantTableDiscriminator(contextProperty = "tenant.code", type = TenantTableDiscriminatorType.SUFFIX) What the function of this class ? Why have so many instantiated and they are not released ? Tnks in advance !
in my persistence.xml i disabled the cache: <persistence-unit name="xxx-ejbPU" transaction-type="JTA"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <jta-data-source>jdbc/xxxx</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> <shared-cache-mode>NONE</shared-cache-mode> <validation-mode>NONE</validation-mode> <properties> <property name="javax.persistence.validation.group.pre-persist" value="javax.validation.groups.Default"/> <property name="javax.persistence.validation.group.pre-update" value="javax.validation.groups.Default"/> <property name="eclipselink.logging.level.sql" value="FINE"/> <property name="eclipselink.logging.parameters" value="true"/> <property name="eclipselink.multitenant.tenants-share-cache" value="false"/> <property name="eclipselink.multitenant.tenants-share-emf" value="false"/> <property name="eclipselink.target-database" value="MySQL"/> <property name="eclipselink.cache.shared.default" value="false"/> </properties> </persistence-unit>
one more detail, glassfish stops by OutOfmemory error
One more info: i not set tenant.code in persistence.xml EVERY EntityManager.createQuery i set the tenant.code manually like this: EntityManager em = getEntityInternalManager(); em.setProperty("tenant.code", idTenacidade); Query qr = em.createQuery.... If I disable support for multi tenant the bug disappears....
This is very important blocker issue for MultiTenant Users
*** Bug 461873 has been marked as a duplicate of this bug. ***
*** Bug 463089 has been marked as a duplicate of this bug. ***
Hello ?
In 2.6.0 ocurs too.
I'm facing a similar problem in my project. We have a multitenant app with MultitenantTableDiscriminator by schema. Sometimes, after some use of the application, we catch this error. See this stack: (...) java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429) at java.util.HashMap$KeyIterator.next(HashMap.java:1453) at org.eclipse.persistence.descriptors.ClassDescriptor.notifyReferencingDescriptorsOfIsolation(ClassDescriptor.java:3952) at org.eclipse.persistence.descriptors.CachePolicy.postInitialize(CachePolicy.java:192) at org.eclipse.persistence.descriptors.ClassDescriptor.postInitialize(ClassDescriptor.java:3940) at org.eclipse.persistence.internal.sessions.AbstractSession.updateTablePerTenantDescriptors(AbstractSession.java:1454) (...) This is similar at your previous issue <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=463089'>463089</a> (that was closed now). Don't you think that sincronyzing the field "ClassDescritor.referencingClasses" should resolve this problem? The real question is, could we sincronyze this part of the code? The modified code should look like this in "ClassDescritor.java": public void notifyReferencingDescriptorsOfIsolation(AbstractSession session) { //Must be sincronyzed to avoid ConcurrentModificationException on the referencingClasses synchronized(this.referencingClasses) { //THIS IS NEW! for (ClassDescriptor descriptor : this.referencingClasses) { if (descriptor.getCachePolicy().getCacheIsolation() == null || descriptor.getCachePolicy().getCacheIsolation() == CacheIsolationType.SHARED) { descriptor.getCachePolicy().setCacheIsolation(CacheIsolationType.PROTECTED); descriptor.getCachePolicy().postInitialize(descriptor, session); for (DatabaseMapping mapping : descriptor.getMappings()) { if (mapping.isAggregateMapping() && (mapping.getReferenceDescriptor() != null)) { mapping.getReferenceDescriptor().getCachePolicy().setCacheIsolation(CacheIsolationType.PROTECTED); } } } } } //NEW }
We have the same problem with MultiTenant setup with Eclipselink 2.6.3 Any progress on this issue
Created attachment 269072 [details] Patch for the ConcurrentException Fixed the issues (against 2.6 branch) - mainly ClassDescriptor clone&synchronized ManagedTypeImpl.init For ManagedTypeImpl, if many threads are creating entity managers, ConcurrentModificationException related to members appears (the second thread reaches the if (null != this.members) and exits - it will access members that are in construction, leading to exceptions and invalid results. All the tenant client session will clone the classdescriptor from the client session (same client session). If there are multiple tenant client sessions started, the notifyReferencingDescriptorsOfIsolation is called for other entity manager, while referencedDescriptors are added from the initialize method. The tests were done with a multitenant & rich data model with 100 parallel threads doing create an EntityManager (with tenant id), start a transaction, commit the transaction.
Created attachment 269073 [details] Patch for the ConcurrentException Re-attached the patch with less new line issues.
Can some test-case be added to this, please? Or at least some detailed description of the setup and entities for which this can be reproduced? Thanks!
Hello, I'm having the same problem, I downloaded the 2.6.5 version, but the problem is still there. Do you know if the updated version was checked into the repository? Thanks!!
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink