Jordi Rambla


Hi,

I'm trying to do an unattended cube processing using AMO, and I simply want to let the user know that warnings and errors occurred (and how many of them) without necessarily stopping the process.

Looking at the Cube.Process method overloads, you'll find out that it is possible to pass an XmlaWarningCollection that, allegedly, should return a warning collection populated with them.

When coding that, the collection is always returned as an empty one (0 items). Again, I'm suspicious that only warnings are allowed and not XmlaError objects or generic XmlaMessages, guessing that I'm misunderstanding the issue.

Alternative methods, like subscribing to a Trace looks overkill due to the roundtrips involved. Saving to a log file and parsing it sounds too much work for something apparently trivial...

Any additional info or suggestion

TIA.

Jordi Rambla

SQL Server MVP





Re: How to get the resulting XmlaWarningCollection in AMO Process?

Darren Gosbell


Hi Jordi,

I just checked and I think you are out of luck with the xmlaWarningCollection. I put an invalid record in a fact table for a test cube. When I process it through the BIDS UI I can see the warnings, but the collection in AMO was always empty. So I "cracked" open AMO using reflector and I found the following:

  • I started at Cube.Process(...)
  • Server.Process(...) is then called, passing the cube as a parameter along with the parameters that were passed into the cube's Process method.
  • analysisServicesClient.Process is then called, passing in every parameter EXCEPT the xmlaWarningCollection, so as far as I can tell this collection is never populated with any data.

I then tried using a raw XMLA command to process the cube, this did return an xmla warning, but all it said was that two errors had been logged.

I can only see two options for you at the moment.

  1. You could specify a log file in the errorconfiguration parameter when you process using AMO, then you could check this file for records after the process has finished. You appear to get one line of text per error/warning
  2. Or you could go down the path of using traces - I think traces is the only way of getting "real time" notification of errors/warnings.

If you have not seen it one of the MS guys posted a sample for using traces here:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=516900&SiteID=1







Re: How to get the resulting XmlaWarningCollection in AMO Process?

Jordi Rambla

Thanks for the testing, Darren.

I know about the two paths you suggest. They are the ones I'm hoping could be avoided.

The first one does not fit because the log file will be in the server, AFAIK.

The second one might be killing for network roundtrips if you have many errors (as happens some times).

I guess this is a wish to send to Microsoft.

Saludos,

Jordi Rambla







Re: How to get the resulting XmlaWarningCollection in AMO Process?

Darren Gosbell

Yes, I believe the log file would have to be stored in a drive on the server, or at least in a location that the server has access to. I honestly don't know what the network traffic is like with the tracing API, but if you don't need that "real time" feedback that you get from tracing then it is a lot of extra work just to get a list of errors/warnings.

The best place to log this is on http://connect.microsoft.com. If you log it there you could post a link to the item back to this thread so that anyone else that has the same issue can look up the item and view it's status and even vote for it to be addressed.

Cheers
Darren






Re: How to get the resulting XmlaWarningCollection in AMO Process?


Re: How to get the resulting XmlaWarningCollection in AMO Process?

Darren Gosbell

Cool, I have added a validation and put in a vote. Even though you logged the issue you might want to add a vote too.

Cheers
Darren