You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/06/23 19:30:04 UTC
[jira] [Assigned] (CAMEL-8864) Camel-Aggregator JDBC repository
always overwrites old exchange
[ https://issues.apache.org/jira/browse/CAMEL-8864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-8864:
----------------------------------
Assignee: Claus Ibsen
> Camel-Aggregator JDBC repository always overwrites old exchange
> ---------------------------------------------------------------
>
> Key: CAMEL-8864
> URL: https://issues.apache.org/jira/browse/CAMEL-8864
> Project: Camel
> Issue Type: Bug
> Components: camel-sql
> Affects Versions: 2.15.2
> Reporter: Pankaj Takawale
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.16.0
>
>
> I'm using FlexibleAggregationStrategy to aggregate objects into collection. I found following issue where Aggregator ends up overwriting old collection with the new one.
> JdbcCamelCodec is not marshaling all of the exchange properties.
> E.g. it does not marshal exchange's 'CamelFlexAggrStrCollectionGuard' property.
> So next time Aggregator tries to fetch BLOB from database, oldExchange does not have above property.
> So following code creates new collection for each new object, and hence overwrites the old collection.
> private Collection<E> FlexibleAggregationStrategy::safeInsertIntoCollection(Exchange oldExchange, Collection<E> oldValue, E toInsert) {
> Collection<E> collection = null;
> try {
> if (oldValue == null || oldExchange.getProperty(COLLECTION_AGGR_GUARD_PROPERTY, Boolean.class) == null) {
> try {
> collection = collectionType.newInstance(); //**EVERYTIME NEW COLLECTION as previous aggregation did not serialize COLLECTION_AGGR_GUARD_PROPERTY to database.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)