![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, In my AS2005 database i have got several cubes and dimensions. Now i'm trying to develop appliacation which helps users made simple enhacements in this db - especially add attribute to dimension. I'm using AMO. My scenario : 1).add new table to datasource view -> no problem 2) add new attribute to _database_ dimension -> there I have got problem with "Update()" call The problem is updating dimension - im using Update(UpdateOptions.ExpandFull) but this fail if my dimension is attached in other cubes, measure grups etc. so i found and tried to explore ImpactCollection: XmlaWarningCollection xmlaW; ImpactDetailCollection impD; dim.Update(UpdateOptions.ExpandFull, UpdateMode.Default,xmlaW,impD,true); Now I have got 14 impatc detail objects, but I dont know what to do next. I'm tried different Update() combination but with no effect. Could anybody give me a hint what should i do ? My goal is to add this attribute, so i will be visible everywhere my dimension is attached. Unfortunately Books Online and MSDN is very poor in AMO objects documentation (only examples helps me a lot at start). Greetings Slawomi Zurek PS: sorry for my english, but I hope You understand a little ;-) |
#3
| |||
| |||
|
|
We have exactly same issue and I escalated it to MS now. Maybe it is not the same case but the reason what we found is when you update that APPDEF lost its db connection information if you are using user id and password to connect source database. The workaround what I am using is reassign userid and password in appdef but I already escalated it to MS because we can't add these step whenever we call update. I hope it will help you. |
#4
| |||
| |||
|
|
We have exactly same issue and I escalated it to MS now. Maybe it is not the same case but the reason what we found is when you update that APPDEF lost its db connection information if you are using user id and password to connect source database. The workaround what I am using is reassign userid and password in appdef but I already escalated it to MS because we can't add these step whenever we call update. I hope it will help you. Thanks for answer. To be quite frank, it is not clear for me waht do you mean by "APPDEF". Anyway, many other Update() calls works well (i'm creating dimesions, updating simple properties of cubes,measures etc). In my scenario (adding attribute to existing and used dimension) Update(UpdateOptions.ExpandFull) throw exeption about invalidate cubes and measures groups: "Errors in the metadata manager. The measure group with the ID of 'FKT Sprzedaz V Distinct L Docelowych', Name of 'FKT Liczba Docelowych' was invalidated by operations in the transaction. Errors in the metadata manager. The cube with the ID of 'Wyniki Operacyjne', Name of 'Wyniki Operacyjne' was invalidated by operations in the transaction. Errors in the metadata manager. The measure group with the ID of 'FKT Sprzedaz', Name of 'FKT Sprzedaz' was invalidated by operations in the transaction. ...... Errors in the metadata manager. The transaction cannot be committed because one or more objects were invalidated during the transaction." I think this behaviour is "by design", because when I did same operation in BI Developement Studio, and click SAVE (not "Save all") i got same error. Everything works well when i click "Save All" - so in fact my question shuold be: "What the hell do Save All in BIDS ?". I suspect some action on ImpactDetailCollection, but i have no idea how to propery use its information. Slawek |
#5
| |||
| |||
|
|
All "affected" objects need to be altered (updated) in the same transaction -- so essentially: Begin Transaction Alter Dimension Dimension.Update Call Update on all affected objects Commit Transaction Thanks, Akshai -- |
#6
| |||
| |||
|
|
All "affected" objects need to be altered (updated) in the same transaction -- so essentially: Begin Transaction Alter Dimension Dimension.Update Call Update on all affected objects Commit Transaction Thanks, Akshai -- Thanks Akshai! My first implemenation was similar to Your answer, but i made some mistakes, and finally go wrong way. Now I manage to Update() my database correctly after adding my new atrribute. But now this is "working solution" which is far, far away form "best/optimized" solution So, please let me ask You some more questions, so I could "organize" just collected knowledge: 1. How to get "affected" objects - I noticed, that after BeginTransaction i cannot call Update() with ImpactAnalysis Options. So I think, i should use one of following method: - call Update() with Impact onlly analysis on unchanged dimension to get collection of all affected object in ImpactAnalysis (Is it proper/possible ?) - loop through all my AS database looking for dependent objects - use some other method of AMO object ;-) 2. How deep should be update of "affected" objects - after altering some object , should I Update() affected objects to the lowest possible level (in my case - after alternig database dimension will be enough to call Update() on Cubes or should I call Update() on Measure Groups too) ? Furthermore, if i already got collection of affected object is there "simple" ;-) method to arrange them in correct order for Update (e.g Cubes before Measures Group etc, etc), or have I to implement this by hand ? 3. Most important - ary You planning to release some better documentation of AMO ? Current help (I use BOL - december 2005) contents do not help me very much (most of desciption is "Thread Safety" and "Platforms" paragraphs ;-) )) Of course I will make some test to figure out how it works, but I will be very thankful for any answer. Slawek |
#7
| |||
| |||
|
|
To save structural changes to an object (like the attribute addition to a dimension in this case), you can use the .Update method with the UpdateOptions.AlterDependents parameter: myDimension.Update(UpdateOptions.AlterDependents); This method will run impact analysis to detect the dependents requiring update and, in the end, will save all of them an once (transactional batch). Impact analysis has indeed the limitation you noticed, you cannot use it inside a transaction. But you can start the transaction after you got the list of dependents from impact analysis, however I hope you no longer need to do that since the .Update(UpdateOptions.AlterDependents) should do what you want. Adrian. "Slawomir Zurek" <slawomir.zurek (AT) HATESPAMpoczta (DOT) fm> wrote in message news:e1ie43$j1s$1 (AT) news (DOT) interia.pl... ..... |
![]() |
| Thread Tools | |
| Display Modes | |
| |