Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Partitioning persists does not consider the partitionPersist() method's connection pool.

Hi,

I'm trying to implement a custom partitioning. After fixing forwarding of method calls in CustomPartitionPolicy, I wonder about a new problem.
There are two methods I can implement, partitionPersist(...) and getConnectionsForQuery(...).

Just looking at the names, I would assume that the first is for persisting entities to the database, while the second is just for querying/retrieving them.

However, when copying the methods from HashPartitioning, I notice that partitionPersist never seems to assign a partition, because the check for an isolatedClientSession makes it return before assigning one.
The partition is then assigned in the getConnectionsForQuery method, even though I am actually trying to persist entities and not read/query them.

Is this a bug, or actually expected/designed like this? I haven't found any good documentation about creating custom partitioning policies.

This leads me to a problem now, because I want the actual object when deciding where to persist it. partitionPersist(...) is supplied with the object in question, so that would be fine if this would be used.
getConnectionsForQuery(...) does not seem to have access to actual objects but is supplied with "AbstractRecord arguments", which seems to only give access to fields of the database record.

I have tried removing the check for an isIsolatedClientSession in partitionPersist(), but that leads to a deadlock (while eclipselink tries to obtain a connection, I guess).

My final goal actually is the following; I have a model like this: A-B-C. Now I want to partition objects of class C based on which A they belong to, but they are not directly connected to A, class B sits in between, thus I need to traverse the relations C->B->A when trying to persist objects of class C.

Regards,
Michael
___________________________________________________

SMA Solar Technology AG
Aufsichtsrat: Guenther Cramer (Vorsitzender)
Vorstand: Juergen Dolle, Roland Grebe, Uwe Hertel, Pierre-Pascal Urbon, Marko Werner
Handelsregister: Amtsgericht Kassel HRB 3972
Sitz der Gesellschaft: 34266 Niestetal
USt-ID-Nr. DE 113 08 59 54
WEEE-Reg.-Nr. DE 95881150
___________________________________________________



Back to the top