Message Stucks (Microsoft.Samples.BizTalk.Adapter.Common ) - biztalk

We use Microsoft.Samples.BizTalk.Adapter.Common library for our custom SMTP Receive Adapter. Everything seems fine except one situation. The message stucks if it larger than approximatly 5 MB and it includes more than two attachments. Our adapter is run on isoletadHost. In query window we see that the message stay in active status. During our investigation we found that it stucks in a batch.Wait() method. Any other messages handling well. We are running Biztalk 2006 Standart.
Could anyone provide us with any suggestion?
SyncReceiveSubmitBatch batch = new SyncReceiveSubmitBatch(transportProxy, terminator, 1);
Int32 count = 0;
foreach (IBaseMessage msg in messages)
{
try
{
batch.SubmitMessage(msg, null);
count++;
}
catch (Exception ex)
{
try
{
msg.SetErrorInfo(ex);
batch.MoveToSuspendQ(msg);
ThreadContext.Properties["EventID"] = 1007;
logger.Error("Submit Error", ex);
}
catch (Exception ex2)
{
ThreadContext.Properties["EventID"] = 1008;
logger.Error("Suspend Error", ex2);
}
}
}
if (count != 0)
{
batch.Done();
if (batch.Wait())
{
ThreadContext.Properties["EventID"] = 1009;
logger.Debug("Messages publised");
}
else
{
ThreadContext.Properties["EventID"] = 1010;
logger.Warn(String.Format("Publish error. Sucssefully publised {1}, error in {0} messages", batch.FailedMessages.Count, count - batch.FailedMessages.Count));
}
}
else
{
ThreadContext.Properties["EventID"] = 1011;
logger.Warn("No message found");
}

This fix: http://support.microsoft.com/kb/928078 helped to solve the problem. Thanks all.

Related

onScanFailure after a certain of time when scanning ble devices in android

I am using rxbleandroid library for scanning Bluetooth devices
fun startScan() {
if(rxBleClient.isScanRuntimePermissionGranted) {
Log.d("TAG", "All permission granted")
}
else {
Log.d("TAG", "Not all permission granted\"")
}
val scanSettings = ScanSettings.Builder()
.setScanMode(SCAN_MODE_BALANCED)
.setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES)
.build()
val scanFilter = ScanFilter.Builder()
.build()
rxBleClient.scanBleDevices(scanSettings, scanFilter)
.observeOn(AndroidSchedulers.mainThread())
.doFinally { dispose() }
.subscribe({scanResult ->
Log.d("TAG", scanResult?.bleDevice?.name!!)
},
{
onScanFailure(it) })
.let {
scanDisposable = it}//
}
private fun dispose() {
//scanDisposable = null
}
private fun onScanFailure(throwable: Throwable) {
Log.d("TAG", "onScanFailure ${throwable. Cause}")
viewModelScope.launch{
delay(6000)
scanDisposable?.dispose()
startScan()
}
}
After a short while a get a onScanFailure event. The output on the screen is
onScanFailure null
The only way to fix it is to wait little bit and restart the scanning.
I am using the latest version of android on a pixel6. The version number of rxAndroidLibraryble is 1.17.0
Am i using the library wrong?
In the callback function you are using this line:
Log.d("TAG", scanResult?.bleDevice?.name!!)
It will throw an NPE once a device with no advertised name will get scanned and that NPE will have no cause.
You could use this:
Log.d("TAG", scanResult?.bleDevice?.name ?: "no name")

How to get network connection status in apple watch standalone application?

Using NWPathMonitor, I get network information in watch simulator (with usesInterfaceType) and it showing right status, but in real device it's not working. It alway showing no network. I developed independent watch application. Please check below code that I write for this:
let monitor = NWPathMonitor()
monitor.pathUpdateHandler = { path in
if path.status == .satisfied {
print("We're connected!")
if path.usesInterfaceType(.wifi) {
print("It's WiFi!")
} else if path.usesInterfaceType(.cellular) {
print("3G/4G FTW!!!")
} else if path.usesInterfaceType(.wiredEthernet) {
print("wiredEthernet")
}else if path.usesInterfaceType(.loopback) {
print("loopback")
}else if path.usesInterfaceType(.other) {
print("other")
}
}
else {
print("No connection.")
}
}
let queue = DispatchQueue(label: "InternetConnectionMonitor")
monitor.start(queue: queue)

GDX-SQLite android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1

I work in Android Studio with libgdx and gdx-sqlite. I want a simple query from my database with the following code.
try {
cursorSettings = dbHandler.rawQuery("SELECT "+COLUMN_SETTING+" FROM "+TABLE_SETTINGS+" WHERE "+COLUMN_SETTINGSID+" =13");
System.out.println(cursorSettings.getLong(0));
} catch (SQLiteGdxException e) {
e.printStackTrace();
}
The Desktop-Version works without problems, but in the android version I get the following error:
05-25 10:21:47.341 11978-12232/ch.shuttering.rapporte E/AndroidRuntime: FATAL EXCEPTION: GLThread 82275
Process: ch.shuttering.rapporte, PID: 11978
android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1
at android.database.AbstractCursor.checkPosition(AbstractCursor.java:460)
at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:74)
at com.badlogic.gdx.sqlite.android.AndroidCursor.getLong(AndroidCursor.java:61)
at ch.shuttering.rapporte.Manager.SQLiteManager.SaveMangerSQLite.creatSQLiteSettings(SaveMangerSQLite.java:295)
at ch.shuttering.rapporte.RapporteMain.create(RapporteMain.java:66)
at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:311)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1546)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1262)
So every time I make a getXXX () query from the cursor I get an error, but if I now use the following code:
try {
cursorSettings = dbHandler.rawQuery("SELECT * FROM "+TABLE_SETTINGS);
} catch (SQLiteGdxException e) {
e.printStackTrace();
}
while (cursorSettings.next()) {
Gdx.app.log("FromDb", String.valueOf(cursorSettings.getString(1)));
}
I have a correct output with all data.
Does anyone have an idea what the problem is?
Thank you for your help
Okay I found the problem by myself, that was the code in the Android class
#Override
public long getLong (int columnIndex) {
try {
return cursor.getLong(columnIndex);
} catch (SQLiteException e) {
Gdx.app.log(DatabaseFactory.ERROR_TAG, "There was an error in getting the long", e);
throw new SQLiteGdxRuntimeException(e);
}
}
The problem is that in android the cursor points to -1 so it must first be set to the correct position, the following code solves the problem
#Override
public long getLong (int columnIndex) {
try {
cursor.moveToFirst();
return cursor.getLong(columnIndex);
} catch (SQLiteException e) {
Gdx.app.log(DatabaseFactory.ERROR_TAG, "There was an error in getting the long", e);
throw new SQLiteGdxRuntimeException(e);
}
}
You can found this code in the library gdx-sqlite-android.jar in the class AndroidCursor.
I hope the solution helps someone.

Need help inresilving the bug

How can i Remove this error. pls Help me in this...
Error 1 Cannot implicitly convert type 'System.Collections.Generic.List<Linq.Model.usp_DisplayrecordsResult>' to 'System.Data.Linq.Link<Linq.Model.usp_DisplayrecordsResult>' C:\Users\anu\Documents\Visual Studio 2010\Projects\Linq.DAL\DAL.cs 23 24 Linq.DAL
method in which error raised is as follows..
Linq.Model.DataAccessDataContext _DataAccessDataContext;
public Link<usp_DisplayrecordsResult> DispPersons()
{
try
{
_DataAccessDataContext = new Linq.Model.DataAccessDataContext();
var query = _DataAccessDataContext.usp_Displayrecords();
List<usp_DisplayrecordsResult> Listresult = new List<usp_DisplayrecordsResult>(query);
return Listresult;
}
catch (Exception ex)
{
throw ex;
}
}
I don't think that you intended to use the Link structure as return type. If you change that to List it will compile:
public List<usp_DisplayrecordsResult> DispPersons()

SQL CE 3.5 problem with TableDirect table access

I try to insert hundreds of records into empty database table using TableDirect type of SqlCeCommand. The problem is I get an exception SqlCeException "Unspecified error" when calling SqlCeResultSet::Insert. Below is my code. Any hints?
Thanks
public bool StoreEventsDB2(List<DAO.Event> events)
{
try
{
SqlCeCommand command = new SqlCeCommand("Event");
command.CommandType = System.Data.CommandType.TableDirect;
SqlCeResultSet rs = _databaseManager.ExecuteResultSet(command, ResultSetOptions.Updatable | ResultSetOptions.Scrollable );
foreach (DAO.Event theEvent in events)
{
SqlCeUpdatableRecord record = rs.CreateRecord();
record.SetInt32( 0, theEvent.ID );
record.SetInt32( 1, theEvent.ParentID);
record.SetString(2, theEvent.Name);
record.SetDateTime(3, theEvent.DateTime);
record.SetDateTime(4, theEvent.LastSynced);
record.SetInt32(5, theEvent.LastSyncedTS);
record.SetString(6, theEvent.VenueName);
record.SetBoolean(7, theEvent.IsParentEvent);
record.SetDateTime(11, DateTime.Now);
rs.Insert(record);
}
}
catch (SqlCeException e)
{
Log.Logger.GetLogger().Log(Log.Logger.LogLevel.ERROR, "[EventManager::StoreEventsDB] error: {0}", e.Message);
return false;
}
catch (Exception e)
{
Log.Logger.GetLogger().Log(Log.Logger.LogLevel.ERROR, "[EventManager::StoreEventsDB] error: {0}", e.Message);
return false;
}
return true;
}
I am unsure how your connection is managed with the database manager which could be the culprit - make sure you are using one connection (sqlce doesn't play nice). Also the results set option "ResultSetOption.Scrollable" is not needed (at least I have never used it for an insert).
Below is the syntax I use when doing direct table inserts. Every database/data access object is wrapped in a using statement to dispose of objects after use - this is very important especially with the compact framework and sqlce as the garbage collection is less than ideal (you WILL get out of memory exceptions!). I have added a transaction to your code also so that the option is all or nothing.
Hope this helps:
using (var transaction = connection.BeginTransaction())
{
using (var command = connection.CreateCommand())
{
command.Transaction = transaction;
command.CommandType = CommandType.TableDirect;
command.CommandText = "Event";
using (var rs = command.ExecuteResultSet(ResultSetOptions.Updatable))
{
var record = rs.CreateRecord();
foreach (DAO.Event theEvent in events)
{
record.SetInt32(0, theEvent.ID);
record.SetInt32(1, theEvent.ParentID);
record.SetString(2, theEvent.Name);
record.SetDateTime(3, theEvent.DateTime);
record.SetDateTime(4, theEvent.LastSynced);
record.SetInt32(5, theEvent.LastSyncedTS);
record.SetString(6, theEvent.VenueName);
record.SetBoolean(7, theEvent.IsParentEvent);
record.SetDateTime(11, DateTime.Now);
rs.Insert(record);
}
}
transaction.Commit();
}
}

Resources