View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001204 | SymmetricDS | Bug | public | 2013-05-08 14:33 | 2014-02-03 01:53 |
Reporter | josema | Assigned To | chenson | ||
Priority | high | ||||
Status | closed | Resolution | fixed | ||
Product Version | 3.3.5 | ||||
Target Version | 3.5.0 | Fixed in Version | 3.5.0 | ||
Summary | 0001204: Invalid target node on "lookup table data router", trouble cache key resolution | ||||
Description | When routing data using "lookup table data router" lookup table data is cached with and invalid cache name. Data is routed using cached data from another lookup table cached previously. API code generate a non unique cache key like "org.jumpmind.symmetric.route.LookupTableDataRouter..null" See correction... Class: org.jumpmind.symmetric.route.LookupTableDataRouter ... protected Map<String, Set<String>> getLookupTable(final Map<String, String> params, Router router, SimpleRouterContext routingContext) { Old Code --------------------------------------------------------vvvvvvvvvvvvv final String CTX_CACHE_KEY = LOOKUP_TABLE_KEY + "." + params.get("TABLENAME"); Old Code --------------------------------------------------------^^^^^^^^^^^ New Code -------------------------------------------------------vvvvvvvvvvvvvv final String CTX_CACHE_KEY = LOOKUP_TABLE_KEY + "." + params.get(PARAM_TABLE); New Code --------------------------------------------------------^^^^^^^^^^^ Map<String, Set<String>> lookupMap = (Map<String, Set<String>>) routingContext .getContextCache().get(CTX_CACHE_KEY); if (lookupMap == null) { ISqlTemplate template = symmetricDialect.getPlatform().getSqlTemplate(); final Map<String, Set<String>> fillMap = new HashMap<String, Set<String>>(); template.query(String.format("select %s, %s from %s", params.get(PARAM_MAPPED_KEY_COLUMN), params.get(PARAM_EXTERNAL_ID_COLUMN), params.get(PARAM_TABLE)), new ISqlRowMapper<Object>() { public Object mapRow(Row rs) { String key = rs.getString(params.get(PARAM_MAPPED_KEY_COLUMN)); String value = rs.getString(params.get(PARAM_EXTERNAL_ID_COLUMN)); Set<String> ids = fillMap.get(key); if (ids == null) { ids = new HashSet<String>(); fillMap.put(key, ids); } ids.add(value); return value; } }); lookupMap = fillMap; routingContext.getContextCache().put(CTX_CACHE_KEY, lookupMap); } return lookupMap; } | ||||
Steps To Reproduce | Routing data when router processes many "lookup table" results with alternate resultset values | ||||
Additional Information | Applies to all versions. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2013-05-08 14:33 | josema | New Issue | |
2013-05-08 14:37 | chenson | Assigned To | => chenson |
2013-05-08 14:37 | chenson | Status | new => assigned |
2013-05-08 14:38 | chenson | Note Added: 0000252 | |
2013-05-08 14:38 | chenson | Status | assigned => resolved |
2013-05-08 14:38 | chenson | Fixed in Version | => 3.5.0 |
2013-05-08 14:38 | chenson | Resolution | open => fixed |
2013-05-08 14:38 | chenson | Target Version | => 3.5.0 |
2013-07-22 21:52 | chenson | Note Added: 0000345 | |
2013-07-22 21:52 | chenson | Status | resolved => closed |
2014-02-03 01:53 | Changeset attached | => SymmetricDS trunk r7172 | |
2015-07-31 01:49 | chenson | Changeset attached | => SymmetricDS master 0dc3e6cb |