@UnionPartitioning does not seem to be using the correct connection pool [message #676447] |
Sat, 04 June 2011 09:28  |
Eclipse User |
|
|
|
When using @UnionPartitioning with the default and named connection pools and the entity is loaded from the named connection pool, the UPDATE to the entity seems to be routed to the default connection instead of the named connection.
The reason for the named connection is to load the entities from the main database schema and from the archive schema. What might be better that getting the UPDATE to route to the archive schema, is be able to have an listener that is able to set a property on the result domain entity that it is a archived entity and therefore no UPDATE/DELETE function should be performed.
I have the following entity mapping:-
@Entity(name = "TrainingCourse")
@Access(AccessType.FIELD)
@Table(name = "course")
@UnionPartitioning(
name="UnionPartitioningAllNodes",
/*Do not replicate changes to all data sources*/
replicateWrites=false)
@Partitioned("UnionPartitioningAllNodes")
public class TrainingCourse extends DomainEntity {
@Id
@Column(name = "course_id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
....
@Version
@Column(name = "version")
}
And I have setup the following connection in the persistence.xml
<property name="eclipselink.connection-pool.archive.jtaDataSource" value="yellowfire.training.archive.ds" />
Thank you in advance
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03268 seconds