View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 931 | RackTables | IPv4/IPv6/SLB | public | 2013-07-11 15:45 | 2014-02-02 07:37 |
| Reporter | heraclide | Assigned To | andriyanov | ||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | closed | Resolution | won't fix | ||
| Product Version | 0.20.3 | ||||
| Summary | 931: scanRealmByText + commitAddObject + bindIpToObject => "Uncaught exception 'EntityNotFoundException'" | ||||
| Description | I'm currently in the process of writing webservices to racktables to automatize data update in a hosting company. So, i made a create.php file, which basically do: scanRealmByText ( to check that object don't already exists in database ) and then commitAddObject and then bindIpToObject The problem is that the scanRealmByText push in $entityCache that the object don't exists, and then when bindIpToObject execute, it fails with spotEntity hitting the cache | ||||
| Steps To Reproduce | $_res = scanRealmByText('object', '{$cn_SOMETHING}'); if ( sizeof( $_res) > 0) { exit; } $_objId = commitAddObject ( 'SOMETHING', 'Label', 122334, 'AZERTY'); bindIPToObject( ip_parse( "1.2.3.4") , $_objId, 'SOMETHING','regular'); | ||||
| Additional Information | Fix can be found at : https://github.com/heraclide/racktables/commit/9954d61077ce94c5b3f2ead7cbb2ca7c5bfe48d8 | ||||
| Tags | No tags attached. | ||||
|
Hello. Caching needs to be refactored at all, I made an attempt in the 'caching' branch, but is not merged yet. I hope to return to this work soon. The cache is stored in the global var $entityCache, so it is possible to invalidate it from any function. The temporary solution is to clear the cache after calling of commitAddObject(). I don't like your patch, because it fixes only one of many issues (almost any call to spotEntity could use invalid cache in some cases). Updating the cache in the commitAddObject() makes more sense to me. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2013-07-11 15:45 | heraclide | New Issue | |
| 2013-07-11 15:45 | heraclide | Status | new => assigned |
| 2013-07-11 15:45 | heraclide | Assigned To | => andriyanov |
| 2013-07-11 17:21 | andriyanov | Note Added: 0001595 | |
| 2013-07-11 17:21 | andriyanov | Assigned To | andriyanov => |
| 2013-07-11 17:21 | andriyanov | Assigned To | => andriyanov |
| 2014-02-02 07:37 | andriyanov | Status | assigned => closed |
| 2014-02-02 07:37 | andriyanov | Resolution | open => won't fix |