SSAS database backup fails with the error 3239837698 - backup

When I run XMLA query to backup SSAS database
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine" Transaction="false" >
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>MyDB</DatabaseID>
</Object>
<File>D:\SSAS\OLAP\Backup\MyDB.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
</Batch>
It runs for an hour, creates backup file, and gives me an error:
<return xmlns="urn:schemas-microsoft-com:xml-analysis">
<results xmlns="http://schemas.microsoft.com/analysisservices/2003/xmla-multipleresults">
<root xmlns="urn:schemas-microsoft-com:xml-analysis:empty">
<Exception xmlns="urn:schemas-microsoft-com:xml-analysis:exception" />
<Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception">
<Error ErrorCode="3239837698" Description="Server: The operation has been cancelled." Source="Microsoft SQL Server 2008 Analysis Services" HelpFile="" />
</Messages>
</root>
</results>
</return>
Log says:
`Microsoft.AnalysisServices.Xmla.XmlaException: Server: The operation has been cancelled.
at Microsoft.AnalysisServices.Xmla.XmlaClient.CheckForSoapFault(XmlReader reader, XmlaResult xmlaResult, Boolean throwIfError)
at Microsoft.AnalysisServices.Xmla.XmlaClient.CheckForError(XmlReader reader, XmlaResult xmlaResult, Boolean throwIfError)
at Microsoft.AnalysisServices.Xmla.XmlaClient.SendMessage(Boolean endReceivalIfException, Boolean readSession, Boolean readNamespaceCompatibility)
at Microsoft.AnalysisServices.Xmla.XmlaClient.SendMessageAndReturnResult(String& result, Boolean skipResult)
at Microsoft.AnalysisServices.Xmla.XmlaClient.Execute(String command, String properties, String& result, Boolean skipResult, Boolean propertiesXmlIsComplete)
at Microsoft.SqlServer.Management.Smo.Olap.SoapClient.ExecuteStatement(String stmt, StatementType stmtType, Boolean withResults, String properties, String parameters, Boolean restrictionListElement, String discoverType, String catalog)
at Microsoft.SqlServer.Management.Smo.Olap.SoapClient.SendCommand(String command, Boolean withResults, String properties)
at OlapEvent(SCH_STEP* pStep, SUBSYSTEM* pSubSystem, SUBSYSTEMPARAMS* pSubSystemParams, Boolean fQueryFlag)Microsoft.AnalysisServices.Xmla.XmlaException: Server: The operation has been cancelled.
`
I am not sure if backup is good.

Try looking at ForceCommitTimeout.

Related

nhibernate for ASP.NET - Could not add assembly ORM_dscnew

I am new to nhibernate. I am facing the following problem:
Exception thrown: 'NHibernate.MappingException' in NHibernate.dll
NHibernate.MappingException: Could not add assembly ORM_dscnew ---> System.IO.FileNotFoundException: Could not load file or assembly 'ORM_dscnew' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
--- End of inner exception stack trace ---
at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
at viroffice.ORM_sessionf.Init() in D:\GDrive\Projects\VirOffice\viroffice\DataObjects\ORM_sessionf.vb:line 7
While executing the function:
Private Shared sFactory As NHibernate.ISessionFactory
Private Shared Sub Init()
Dim config As New NHibernate.Cfg.Configuration()
Try
config.AddAssembly("ORM_dscnew")
sFactory = config.BuildSessionFactory()
Catch ex As Exception
System.Diagnostics.Debug.WriteLine(ex)
Exit Sub
End Try
End Sub
While executing the above function, I am getting the error.
ORM_dscnew.hbm.xml:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns = "urn:nhibernate-mapping-2.2" namespace = "viroffice.DataObjects" assembly = "viroffice">
<class name = "ORM_dscnew" table="dsc_new">
<id name = "new_id">
<generator class = "native"/>
</id>
<property name = "vnm" />
<property name = "vcn_name" />
<property name = "vref" />
<property name = "vcn_per" />
<property name = "vcn_no" />
<property name = "vcn_email" />
<property name = "vcn_email1" />
<property name = "vrmks" />
<property name = "vstatus" />
<property name = "vapp_id" />
<property name = "vmob_ver" />
<property name = "vchg_code" />
</class>
</hibernate-mapping>
Kindly advice what needs to be done?
Using AddAssembly("ORM_dscnew") result in a call to System.Reflection.Assembly.Load("ORM_dscnew"). And in your case, the .Net Framework is unable to find your assembly and yields a FileNotFoundException.
NHibernate just wrap it in a MappingException. The root trouble is your assembly being not found (or one of its dependencies...). Microsoft docs states the assembly name should be a long name, and your code only supply the simple name, so maybe that is your issue.
Anyway, personally, I favor adding an assembly by getting it from a type contained in it. Of course, this implies your factory will need a reference to such a type.
config.AddAssembly(typeof(ATypeInORM_dscnew).Assembly);

serializing soap response in vb.net

Using response As WebResponse = request.GetResponse()
Using rd As New StreamReader(response.GetResponseStream())
Dim soapResult As String = rd.ReadToEnd()
SerializeCollection(soapResult)
the soapResult generate the following :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<createShipmentResponse xmlns="http://www.royalmailgroup.com/api/ship/V2">
<integrationHeader>
<dateTime xmlns="http://www.royalmailgroup.com/integration/core/V1">2016-03-23T06:55:32</dateTime>
<version xmlns="http://www.royalmailgroup.com/integration/core/V1">2</version>
<identification xmlns="http://www.royalmailgroup.com/integration/core/V1">
<applicationId>RMG-API-G-01</applicationId>
<transactionId>730222611</transactionId>
</identification>
</integrationHeader>
<integrationFooter>
<errors xmlns="http://www.royalmailgroup.com/integration/core/V1">
<error>
<errorCode>E1105</errorCode>
<errorDescription>The countryCode specified is not valid</errorDescription>
</error>
<error>
<errorCode>E1001</errorCode>
<errorDescription>Postcode AA9 0AA invalid</errorDescription>
</error>
</errors>
<warnings xmlns="http://www.royalmailgroup.com/integration/core/V1">
<warning>
<warningCode>W0036</warningCode>
<warningDescription>E-mail option not selected so e-mail address will be ignored</warningDescription>
</warning>
<warning>
<warningCode>W0035</warningCode>
<warningDescription>SMS option not selected so Telephone Number will be ignored</warningDescription>
</warning>
</warnings>
</integrationFooter>
</createShipmentResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
i am using this method to serialize this response :
Private Sub SerializeCollection(filename As String)
Dim Emps As createShipmentResponse = New createShipmentResponse()
' Note that only the collection is serialized -- not the
' CollectionName or any other public property of the class.
Dim x As XmlSerializer = New XmlSerializer(GetType(createShipmentResponse))
Dim writer As TextWriter = New StreamWriter(filename)
x.Serialize(writer, Emps)
writer.Close()
End Sub
but i am having this error : Illegal characters in path
what does that mean ? and how can i fix this ?
Your SerializeCollection() method expects a file path to serialize to a file. You're currently passing the contents of your response which is why it doesn't work.
If you haven't written the method yourself I think you've not found completely what you're looking for.
This is an example of how the method should be called:
SerializeCollection("C:\Users\Vincent\Desktop\Hello.bin") 'The extension doesn't need to be '.bin', but it's an example.
The method has currently no way of getting your response, for that you should add a second parameter.
As I'm not familiar with Soap serialization I'm afraid I cannot help you further.

How is it possible that not calling OracleDataReader.Read() still returns a row?

When I upgraded to use OracleManagedDataAccess provider, the code below did not work, I was baffled because the source code has never change since inception, and its on production server.
I understand why it does not work, as it not calling OracleDataReader.Read()
So, is this a bug that has been indentified by Oracle? Could you point to documentation if yes? Before project was simply referencing 4.112.4.0, now I'm using Oracle.ManagedDataAccess
Anyone else find this interesting?
Public Function GeCount(ByVal value As Integer) As Integer
Dim pCount As New PageCount
Using conn As OracleConnection = New OracleConnection(connString)
'conn.Open()
Using cmd As OracleCommand = New OracleCommand()
cmd.Connection = conn
pCount.PageCnt = 0
cmd.CommandText = "SELECT COUNT(*) FROM dual"
cmd.Connection.Open()
Using rdr As OracleDataReader = cmd.ExecuteReader()
If rdr.HasRows Then
If Not rdr.IsDBNull(0) Then pCount.PageCnt = CInt(CInt(rdr.GetDecimal(0)) / pSize)
End If
End Using
cmd.Connection.Close()
cmd.Dispose()
End Using
conn.Dispose()
End Using
Return pCount
End Function
Any ideas?
EDIT
After switching to use Oracle.ManagedDataAccess.dll, I get this error, which is expected, but it was working before with a reference to Oracle Data Access Client 4.112.4.0
- <Fault xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/none">
- <Code>
<Value>Receiver</Value>
- <Subcode>
<Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</Value>
</Subcode>
</Code>
- <Reason>
<Text xml:lang="en-US">Invalid attempt to read when no data is present</Text>
</Reason>
- <Detail>
- <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HelpLink i:nil="true" />
<InnerException i:nil="true" />
<Message>Invalid attempt to read when no data is present</Message>
<StackTrace>at Oracle.ManagedDataAccess.Client.OracleDataReader.IsDBNull(Int32 i) at WcfRestService1.WcfRestService1.SiteEDocXRefRepository.GetSiteEDocCount(Int32 site_id) at WcfRestService1.WcfRestService1.EDocSvc.GetCntCollectionXRefSiteEDoc(String site_id) at SyncInvokeGetCntCollectionXRefSiteEDoc(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>System.InvalidOperationException</Type>
</ExceptionDetail>
</Detail>
</Fault>

How to extract individual/child nodes from a KML file in VisualBasic?

I need to be able to extract individual nodes from this file into variables for further manipulation. I'm writing to the console to see what information is being pulled, but I am struggling to pull the name or description.
I can successfully print the entire file. I've tried getting individual nodes using placemark.<name>.Value and placemark.Element("name").Value, the second of which throws a NullReferenceException. Any ideas on how to be able to pull out the name and description in this instance?
Imports System.Xml
Imports System.Xml.Linq 'Visual Studio 2015 tells me this isn't needed
Imports System.Core 'Visual Studio 2015 tells me this isn't needed
Dim file As XDocument = XDocument.Load(filePath)
Dim placemarks As IEnumerable(Of XElement) = From test In file.Root.Elements()
For Each placemark As XElement In placemarks
Console.WriteLine(placemark) 'This works
Console.WriteLine(placemark.<name>.Value) 'This prints an empty line
Console.WriteLine(placemark.Element("description").Value) 'This throws a NullReferenceException
Next
This is the structure
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Document>
<name>Untitled layer</name>
<Placemark>
<name>Name 1</name>
<description>Description 1</description>
<ExtendedData>
<Data name='Test data one'>
<value>Test data 1</value>
</Data>
</ExtendedData>
<Point>
<coordinates>34725567547</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Name 2</name>
<description>Description 2</description>
<ExtendedData>
<Data name='Test data two'>
<value>Test data 2</value>
</Data>
</ExtendedData>
<Point>
<coordinates>056795763767</coordinates>
</Point>
</Placemark>
If I have understood you correctly, you are trying to fetch the name & description present inside the PlaceMark node. But, since you are only fetching Root.Elements() your query will only fetch the complete XML starting from your root node.
You need to find the Descendants of PlaceMark node because you need to fetch the name & description inside it. Also, since the root node kml consists of namespace you need to specify that as well.
Here is the code:-
Dim ns As XNamespace = "http://www.opengis.net/kml/2.2"
Dim placeMarks = From test In file.Root.Element(ns + "Document")
.Descendants(ns + "Placemark") Select test
For Each pm In placeMarks
Console.WriteLine("Name: {0}", pm.Element(ns + "name").Value)
Console.WriteLine("Description: {0}", pm.Element(ns + "description").Value)
Console.WriteLine()
Next
I am getting following output:-

WCF DataContractSerializer Behavior

I'm seeing some unusual behavior when using the DataContractSerializer. I have defined a message contract like so:
namespace MyNamespace.DataContracts
{
[MessageContract(WrapperName = "order", WrapperNamespace = #"http://example.com/v1/order")]
public class MyOrder
{
[MessageBodyMember(Namespace = #"http://example.com/v1/order", Order = 1)]
public MyStore store;
[MessageBodyMember(Namespace = #"http://example.com/v1/order", Order = 2)]
public MyOrderHeader orderHeader;
[MessageBodyMember(Namespace = #"http://example.com/v1/order", Order = 3)]
public List<MyPayment> payments;
[MessageBodyMember(Namespace = #"http://example.com/v1/order", Order = 4)]
public List<MyShipment> shipments;
}
.
.
I'm sending it an XML message that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<order xmlns="http://example.com/v1/order>
<store>
...
</store>
<orderHeader>
...
</orderHeader>
<payments>
<payment>
...
</payment>
</payments>
<shipments>
<shipment>
...
</shipment>
</shipments>
</order>
My service deserializes this XML as expected. Inside my service, I'm using the DataContractSerializer to create an XML string and that's where things get weird. I'm using the serializer like this:
DataContractSerializer serializer = new DataContractSerializer(typeof(MyOrder));
using (MemoryStream ms = new MemoryStream())
{
serializer.WriteObject(ms, order);
ms.Position = 0;
StreamReader sr = new StreamReader(ms);
string outputMessage = sr.ReadToEnd();
}
Once this finishes, the outputMessage contains the following XML:
<?xml version="1.0" encoding="utf-8"?>
<MyOrder xmlns="http://example.com/v1/order" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<order>
<store>
...
</store>
<orderHeader>
...
</orderHeader>
<payments>
<payment>
...
</payment>
</payments>
<shipments>
<shipment>
...
</shipment>
</shipments>
</order>
</MyOrder>
Needless to say, anything expecting to receive the original XML message will fail to parse this. So I guess I have two questions:
Why is the DataContractSerializer
adding the extra outer node to my
XML output?
Is there a way to stop it from doing
this?
Thanks.
I should probably add this is with .NET 4.
You could try using WriteObjectContent instead of WriteObject, but I'm unable to reproduce your problem using the code you supplied. All the extra class defintions that are part of your message contract are empty in my definition, but this is the XML I am getting:
<MyOrder xmlns="http://schemas.datacontract.org/2004/07/SandboxApp"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<orderHeader i:nil="true"/>
<payments i:nil="true"/>
<shipments i:nil="true"/>
<store i:nil="true"/>
</MyOrder>
Which also seems odd, since it seems to ignore the WrapperName. Same result in .NET 3.5 SP1 and .NET 4.0.