dbTalk Databases Forums  

Using the UpdateCells XMLA element

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Using the UpdateCells XMLA element in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Zoltan Grose
 
Posts: n/a

Default Using the UpdateCells XMLA element - 03-14-2006 , 11:25 PM






Can I/should I be using AdomdClient to execute a series a XMLA commands?
This is what I have so far but UpdateCells is looking for a ResultId on the
server. How can I get the ResultId from the response to the <Statement> and
how would I add that to the <UpdateCells> command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial
Catalog=Finance Modeling QA;Integrated Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time],
[2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline
Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape
(1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />";
cmd.Execute();



Reply With Quote
  #2  
Old   
Akshai Mirchandani [MS]
 
Posts: n/a

Default Re: Using the UpdateCells XMLA element - 03-14-2006 , 11:41 PM






This API is very complex to use and I wouldn't recommend using it -- it is
used internally by the OLE DB provider to support the cellset update
capability. You won't be able to do it with ADOMD.NET anyway because it
requires an extra SOAP header which ADOMD.NET won't set/get (and you can't
customize this)...

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote

Quote:
Can I/should I be using AdomdClient to execute a series a XMLA commands?
This is what I have so far but UpdateCells is looking for a ResultId on
the server. How can I get the ResultId from the response to the
Statement> and how would I add that to the <UpdateCells> command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial
Catalog=Finance Modeling QA;Integrated Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved
Time], [2005 Working Outlook], [Reserved Project], [Reserved Location],
[Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape
(1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />";
cmd.Execute();




Reply With Quote
  #3  
Old   
Zoltan Grose
 
Posts: n/a

Default Re: Using the UpdateCells XMLA element - 03-15-2006 , 11:23 AM



Its complex, but if UpdateCells can have 0...n Cell elements like the docs
describe it provides the mid-tier to back-end batching that I crave. Even
the old ADOMD isn't batching updates (you can see each UpdateCells statement
coming across inthe SQL Profiler).

Time to dig up those SOAP classes...

Thanks for the validation.

-z

"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote

Quote:
This API is very complex to use and I wouldn't recommend using it -- it is
used internally by the OLE DB provider to support the cellset update
capability. You won't be able to do it with ADOMD.NET anyway because it
requires an extra SOAP header which ADOMD.NET won't set/get (and you can't
customize this)...

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Can I/should I be using AdomdClient to execute a series a XMLA commands?
This is what I have so far but UpdateCells is looking for a ResultId on
the server. How can I get the ResultId from the response to the
Statement> and how would I add that to the <UpdateCells> command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial
Catalog=Finance Modeling QA;Integrated Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved
Time], [2005 Working Outlook], [Reserved Project], [Reserved Location],
[Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape
(1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />";
cmd.Execute();






Reply With Quote
  #4  
Old   
Akshai Mirchandani [MS]
 
Posts: n/a

Default Re: Using the UpdateCells XMLA element - 03-15-2006 , 04:32 PM



Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to do
it in a "safe" manner. I.e. when a cell is updated, it can't know if another
cell value in the cellset has been impacted by the update -- so the next
"Read" operation on the cellset will trigger a <UpdateCells> and refresh of
cellset values.

So if your code just did "update, update, update, commit" (without any
"reads"), it should see just one <UpdateCells> message. Of course, ADOMD
adds another layer into the mix and I can't say whether it would cause a
"read" operation when all your code does is Writes.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote

Quote:
Its complex, but if UpdateCells can have 0...n Cell elements like the docs
describe it provides the mid-tier to back-end batching that I crave. Even
the old ADOMD isn't batching updates (you can see each UpdateCells
statement coming across inthe SQL Profiler).

Time to dig up those SOAP classes...

Thanks for the validation.

-z

"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message
news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
This API is very complex to use and I wouldn't recommend using it -- it
is used internally by the OLE DB provider to support the cellset update
capability. You won't be able to do it with ADOMD.NET anyway because it
requires an extra SOAP header which ADOMD.NET won't set/get (and you
can't customize this)...

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Can I/should I be using AdomdClient to execute a series a XMLA commands?
This is what I have so far but UpdateCells is looking for a ResultId on
the server. How can I get the ResultId from the response to the
Statement> and how would I add that to the <UpdateCells> command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data
Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated
Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved
Time], [2005 Working Outlook], [Reserved Project], [Reserved Location],
[Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite
Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />";
cmd.Execute();








Reply With Quote
  #5  
Old   
Zoltan Grose
 
Posts: n/a

Default Re: Using the UpdateCells XMLA element - 03-15-2006 , 09:32 PM



I was trying it with ADOMD 2.8 and it would do the UpdateCells after the
next cell was set. For example:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
cell.Value = 2000;
// UpdateCells seen on server for ordinal 0 with value 1000
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);
cell.Value = 3000;
// UpdateCells seen on server for ordinal 1 with value 2000

Even when I commited the transaction, the most recent cell to be set was not
updated (the value of 3000 in my example) unless another cell was accessed.

What I *did* notice is that if I set the value for a cell repeatedly and
then commited the transaction, only 1 writeback table entry was created. So
there was batching between the 2 server side processes, but not at the layer
I'm most interested in.

-zoltan


"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote

Quote:
Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to do
it in a "safe" manner. I.e. when a cell is updated, it can't know if
another cell value in the cellset has been impacted by the update -- so
the next "Read" operation on the cellset will trigger a <UpdateCells> and
refresh of cellset values.

So if your code just did "update, update, update, commit" (without any
"reads"), it should see just one <UpdateCells> message. Of course, ADOMD
adds another layer into the mix and I can't say whether it would cause a
"read" operation when all your code does is Writes.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Its complex, but if UpdateCells can have 0...n Cell elements like the
docs describe it provides the mid-tier to back-end batching that I crave.
Even the old ADOMD isn't batching updates (you can see each UpdateCells
statement coming across inthe SQL Profiler).

Time to dig up those SOAP classes...

Thanks for the validation.

-z

"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message
news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
This API is very complex to use and I wouldn't recommend using it -- it
is used internally by the OLE DB provider to support the cellset update
capability. You won't be able to do it with ADOMD.NET anyway because it
requires an extra SOAP header which ADOMD.NET won't set/get (and you
can't customize this)...

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Can I/should I be using AdomdClient to execute a series a XMLA
commands? This is what I have so far but UpdateCells is looking for a
ResultId on the server. How can I get the ResultId from the response to
the <Statement> and how would I add that to the <UpdateCells> command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data
Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated
Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved
Time], [2005 Working Outlook], [Reserved Project], [Reserved Location],
[Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite
Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
cmd.Execute();










Reply With Quote
  #6  
Old   
Akshai Mirchandani [MS]
 
Posts: n/a

Default Re: Using the UpdateCells XMLA element - 03-17-2006 , 12:45 AM



And what if you did:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);

coords = new object[2] { 0, 0 };
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell.Value = 2000;
coords = new object[2] { 0, 2 };
cell.Value = 3000;

And then Commit. You should (theoretically) see only one UpdateCells
request...

As I said, I'm not sure what ADOMD does in between, so its possible that the
cell update causes a Read which would result in each modification also
sending a message.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote

Quote:
I was trying it with ADOMD 2.8 and it would do the UpdateCells after the
next cell was set. For example:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
cell.Value = 2000;
// UpdateCells seen on server for ordinal 0 with value 1000
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);
cell.Value = 3000;
// UpdateCells seen on server for ordinal 1 with value 2000

Even when I commited the transaction, the most recent cell to be set was
not updated (the value of 3000 in my example) unless another cell was
accessed.

What I *did* notice is that if I set the value for a cell repeatedly and
then commited the transaction, only 1 writeback table entry was created.
So there was batching between the 2 server side processes, but not at the
layer I'm most interested in.

-zoltan


"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message
news:uQAalBISGHA.4276 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to
do it in a "safe" manner. I.e. when a cell is updated, it can't know if
another cell value in the cellset has been impacted by the update -- so
the next "Read" operation on the cellset will trigger a <UpdateCells> and
refresh of cellset values.

So if your code just did "update, update, update, commit" (without any
"reads"), it should see just one <UpdateCells> message. Of course, ADOMD
adds another layer into the mix and I can't say whether it would cause a
"read" operation when all your code does is Writes.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Its complex, but if UpdateCells can have 0...n Cell elements like the
docs describe it provides the mid-tier to back-end batching that I
crave. Even the old ADOMD isn't batching updates (you can see each
UpdateCells statement coming across inthe SQL Profiler).

Time to dig up those SOAP classes...

Thanks for the validation.

-z

"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in
message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
This API is very complex to use and I wouldn't recommend using it -- it
is used internally by the OLE DB provider to support the cellset update
capability. You won't be able to do it with ADOMD.NET anyway because it
requires an extra SOAP header which ADOMD.NET won't set/get (and you
can't customize this)...

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Can I/should I be using AdomdClient to execute a series a XMLA
commands? This is what I have so far but UpdateCells is looking for a
ResultId on the server. How can I get the ResultId from the response
to the <Statement> and how would I add that to the <UpdateCells
command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data
Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated
Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved
Time], [2005 Working Outlook], [Reserved Project], [Reserved
Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS,
{ [Censite Tape (1712522)].Children } ON ROWS FROM [Capital
Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
cmd.Execute();












Reply With Quote
  #7  
Old   
Zoltan Grose
 
Posts: n/a

Default Re: Using the UpdateCells XMLA element - 03-22-2006 , 02:27 PM



Well, I was able to puzzle out the XMLA commands by tweaking an old WSDL
file and using an HTTP tunnel to watch the traffic and seem to have gotten
things to work.

Its odd that the UpdateCells command is even documented on MSDN since you
need to use several undocumented commands to actually use it. =)

This will also give me finer control over my server roundtrips, so I think
it's a win-win for me.

Now on to the performance testing....

-zoltan


"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote

Quote:
And what if you did:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);

coords = new object[2] { 0, 0 };
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell.Value = 2000;
coords = new object[2] { 0, 2 };
cell.Value = 3000;

And then Commit. You should (theoretically) see only one UpdateCells
request...

As I said, I'm not sure what ADOMD does in between, so its possible that
the cell update causes a Read which would result in each modification also
sending a message.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:u$z7FqKSGHA.256 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I was trying it with ADOMD 2.8 and it would do the UpdateCells after the
next cell was set. For example:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
cell.Value = 2000;
// UpdateCells seen on server for ordinal 0 with value 1000
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);
cell.Value = 3000;
// UpdateCells seen on server for ordinal 1 with value 2000

Even when I commited the transaction, the most recent cell to be set was
not updated (the value of 3000 in my example) unless another cell was
accessed.

What I *did* notice is that if I set the value for a cell repeatedly and
then commited the transaction, only 1 writeback table entry was created.
So there was batching between the 2 server side processes, but not at the
layer I'm most interested in.

-zoltan


"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message
news:uQAalBISGHA.4276 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to
do it in a "safe" manner. I.e. when a cell is updated, it can't know if
another cell value in the cellset has been impacted by the update -- so
the next "Read" operation on the cellset will trigger a <UpdateCells
and refresh of cellset values.

So if your code just did "update, update, update, commit" (without any
"reads"), it should see just one <UpdateCells> message. Of course, ADOMD
adds another layer into the mix and I can't say whether it would cause a
"read" operation when all your code does is Writes.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Its complex, but if UpdateCells can have 0...n Cell elements like the
docs describe it provides the mid-tier to back-end batching that I
crave. Even the old ADOMD isn't batching updates (you can see each
UpdateCells statement coming across inthe SQL Profiler).

Time to dig up those SOAP classes...

Thanks for the validation.

-z

"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in
message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
This API is very complex to use and I wouldn't recommend using it --
it is used internally by the OLE DB provider to support the cellset
update capability. You won't be able to do it with ADOMD.NET anyway
because it requires an extra SOAP header which ADOMD.NET won't set/get
(and you can't customize this)...

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Can I/should I be using AdomdClient to execute a series a XMLA
commands? This is what I have so far but UpdateCells is looking for a
ResultId on the server. How can I get the ResultId from the response
to the <Statement> and how would I add that to the <UpdateCells
command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data
Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated
Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved
Time], [2005 Working Outlook], [Reserved Project], [Reserved
Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS,
{ [Censite Tape (1712522)].Children } ON ROWS FROM [Capital
Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
cmd.Execute();














Reply With Quote
  #8  
Old   
Mike Washburn
 
Posts: n/a

Default Re: Using the UpdateCells XMLA element - 03-23-2006 , 11:18 AM



So how did you get the ResultID? I am having the same problem.

Thanks,
Mike


"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote

Quote:
Well, I was able to puzzle out the XMLA commands by tweaking an old WSDL
file and using an HTTP tunnel to watch the traffic and seem to have gotten
things to work.

Its odd that the UpdateCells command is even documented on MSDN since you
need to use several undocumented commands to actually use it. =)

This will also give me finer control over my server roundtrips, so I think
it's a win-win for me.

Now on to the performance testing....

-zoltan


"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message
news:e4Spo5YSGHA.224 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
And what if you did:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);

coords = new object[2] { 0, 0 };
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell.Value = 2000;
coords = new object[2] { 0, 2 };
cell.Value = 3000;

And then Commit. You should (theoretically) see only one UpdateCells
request...

As I said, I'm not sure what ADOMD does in between, so its possible that
the cell update causes a Read which would result in each modification
also sending a message.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:u$z7FqKSGHA.256 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I was trying it with ADOMD 2.8 and it would do the UpdateCells after the
next cell was set. For example:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
cell.Value = 2000;
// UpdateCells seen on server for ordinal 0 with value 1000
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);
cell.Value = 3000;
// UpdateCells seen on server for ordinal 1 with value 2000

Even when I commited the transaction, the most recent cell to be set was
not updated (the value of 3000 in my example) unless another cell was
accessed.

What I *did* notice is that if I set the value for a cell repeatedly and
then commited the transaction, only 1 writeback table entry was created.
So there was batching between the 2 server side processes, but not at
the layer I'm most interested in.

-zoltan


"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in
message news:uQAalBISGHA.4276 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to
do it in a "safe" manner. I.e. when a cell is updated, it can't know if
another cell value in the cellset has been impacted by the update -- so
the next "Read" operation on the cellset will trigger a <UpdateCells
and refresh of cellset values.

So if your code just did "update, update, update, commit" (without any
"reads"), it should see just one <UpdateCells> message. Of course,
ADOMD adds another layer into the mix and I can't say whether it would
cause a "read" operation when all your code does is Writes.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Its complex, but if UpdateCells can have 0...n Cell elements like the
docs describe it provides the mid-tier to back-end batching that I
crave. Even the old ADOMD isn't batching updates (you can see each
UpdateCells statement coming across inthe SQL Profiler).

Time to dig up those SOAP classes...

Thanks for the validation.

-z

"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in
message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
This API is very complex to use and I wouldn't recommend using it --
it is used internally by the OLE DB provider to support the cellset
update capability. You won't be able to do it with ADOMD.NET anyway
because it requires an extra SOAP header which ADOMD.NET won't
set/get (and you can't customize this)...

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Can I/should I be using AdomdClient to execute a series a XMLA
commands? This is what I have so far but UpdateCells is looking for
a ResultId on the server. How can I get the ResultId from the
response to the <Statement> and how would I add that to the
UpdateCells> command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data
Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated
Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved
Time], [2005 Working Outlook], [Reserved Project], [Reserved
Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS,
{ [Censite Tape (1712522)].Children } ON ROWS FROM [Capital
Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
cmd.Execute();
















Reply With Quote
  #9  
Old   
Zoltan Grose
 
Posts: n/a

Default Re: Using the UpdateCells XMLA element - 04-06-2006 , 01:02 PM



You need to send a <KeepResult> element as a SOAP Header to have SSAS send
you back the ResultId. Don't look for it in the docs. =) Helps to get a
somewhat current WSDL for XMLA. I had to hack up something from a samples
download. Contact me thru email if you'd like to get a copy of that WSDL
(provided AS-IS :] ) and an example of how to use it.

-z




"Mike Washburn" <mwashburn (AT) discussions (DOT) microsoft.com> wrote

Quote:
So how did you get the ResultID? I am having the same problem.

Thanks,
Mike


"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:uPoXg9eTGHA.2276 (AT) tk2msftngp13 (DOT) phx.gbl...
Well, I was able to puzzle out the XMLA commands by tweaking an old WSDL
file and using an HTTP tunnel to watch the traffic and seem to have
gotten things to work.

Its odd that the UpdateCells command is even documented on MSDN since you
need to use several undocumented commands to actually use it. =)

This will also give me finer control over my server roundtrips, so I
think it's a win-win for me.

Now on to the performance testing....

-zoltan


"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message
news:e4Spo5YSGHA.224 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
And what if you did:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);

coords = new object[2] { 0, 0 };
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell.Value = 2000;
coords = new object[2] { 0, 2 };
cell.Value = 3000;

And then Commit. You should (theoretically) see only one UpdateCells
request...

As I said, I'm not sure what ADOMD does in between, so its possible that
the cell update causes a Read which would result in each modification
also sending a message.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:u$z7FqKSGHA.256 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I was trying it with ADOMD 2.8 and it would do the UpdateCells after the
next cell was set. For example:

coords = new object[2] { 0, 0 };
cell = cellset.get_Item(ref coords);
cell.Value = 1000;
coords = new object[2] { 0, 1 };
cell = cellset.get_Item(ref coords);
cell.Value = 2000;
// UpdateCells seen on server for ordinal 0 with value 1000
coords = new object[2] { 0, 2 };
cell = cellset.get_Item(ref coords);
cell.Value = 3000;
// UpdateCells seen on server for ordinal 1 with value 2000

Even when I commited the transaction, the most recent cell to be set
was not updated (the value of 3000 in my example) unless another cell
was accessed.

What I *did* notice is that if I set the value for a cell repeatedly
and then commited the transaction, only 1 writeback table entry was
created. So there was batching between the 2 server side processes, but
not at the layer I'm most interested in.

-zoltan


"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in
message news:uQAalBISGHA.4276 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has
to do it in a "safe" manner. I.e. when a cell is updated, it can't
know if another cell value in the cellset has been impacted by the
update -- so the next "Read" operation on the cellset will trigger a
UpdateCells> and refresh of cellset values.

So if your code just did "update, update, update, commit" (without any
"reads"), it should see just one <UpdateCells> message. Of course,
ADOMD adds another layer into the mix and I can't say whether it would
cause a "read" operation when all your code does is Writes.

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Its complex, but if UpdateCells can have 0...n Cell elements like the
docs describe it provides the mid-tier to back-end batching that I
crave. Even the old ADOMD isn't batching updates (you can see each
UpdateCells statement coming across inthe SQL Profiler).

Time to dig up those SOAP classes...

Thanks for the validation.

-z

"Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in
message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
This API is very complex to use and I wouldn't recommend using it --
it is used internally by the OLE DB provider to support the cellset
update capability. You won't be able to do it with ADOMD.NET anyway
because it requires an extra SOAP header which ADOMD.NET won't
set/get (and you can't customize this)...

Thanks,
Akshai
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message
news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Can I/should I be using AdomdClient to execute a series a XMLA
commands? This is what I have so far but UpdateCells is looking for
a ResultId on the server. How can I get the ResultId from the
response to the <Statement> and how would I add that to the
UpdateCells> command?

AdomdConnection conn = new AdomdConnection();
conn.ConnectionString = "Provider=msolap;Data
Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated
Security=SSPI";
conn.Open();
string mdx = null;
mdx = "<BeginTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
AdomdCommand cmd = new AdomdCommand(mdx, conn);
cmd.Execute();
cmd.CommandText = "<Statement
xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT {
([Reserved Time], [2005 Working Outlook], [Reserved Project],
[Reserved Location], [Guideline Price], [Reserved Organization]) }
ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM
[Capital Cube]</Statement>";
cmd.ExecuteCellSet();
cmd.CommandText = "<UpdateCells
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell
Ordinal=\"0\"><Value
xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>";
cmd.Execute();
cmd.CommandText = "<CommitTransaction
xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"
/>";
cmd.Execute();


















Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.