Thank you very much for your answer...
> Data Visibility should not be a problem as long as it is committed, it need
> not have been flushed to disk. Raja , the OLEDB Expert in my team, says
> that you might be using scrollable-*insensitive* cursor which has a cached
> result set. If you do not want to cache, you might want to open
> scrollable-sensitive cursor which directly reads from the table. If this is
> not possible, you need to execute the query again.
I'll look around to find how it's done (I'll send you the properties and
values I'm currently using) Anyway, I run the query every time, that's what
annoys me. I'm creating a new command, setting the command text and executing
it every time, so I don't think it would be the problem... I'll check for the
sensitive cursor mode and try to see if it improves the issue.
> Please stick to having an "dummy" connection in Open State.
I'm trying to do it by all means... it improves the performance
exponentially... and I tnik it's normal... it's avoiding a lot of overhead.
There are some devices though that run very fast even without the dummy
connection, so our application allows the user to configure the presence of
the dummy connection.
> By default, SQL CE/Mobile has a background thread that flushes the changes
> to disk. So it is a kind of asynchronous commit which happens every 10
> seconds.
I've tried the TCM_FLUSH property in the session... it does not affect the
performance at all whe I keep the dummy connection open (I know there should
be some performance penalty but it's imperceptible for my application)
Whereas you use this flag or not, the data visibility issue persists. It
makes sense, because of what you say in your second message: transactions
have to be committed, not neccesarily flushed. Anyway, even when they are
flushed inmediately the problem persists.
> 3) Long running application leads to memory leak
> I am not sure of this claim as we have many applications built on SQL CE
> and they run for long hours and we have not seen memory leaks so far.
I'm not sure whether there's a problem with SQL CE or our application.
That's why we've try to work around the problem. Memory leaks are very
difficult to trace in the mobile environment, so we're more concerned with
the data visibility issue which is out of our reach. In fact, when a mobile
user has an application error he's more prone to reset the device and start
over again than a desktop or web user is. It's hard to say, but that's the
way it is. Restarting a mobile application in a timely fashion is something a
user is able to understand... they're even prone to open the application,
execute the selected tasks and then close it.
> However, I see that it is just a perception. SQL CE has a shared memory
> to host preallocated buffer pool, ...etc. This will be there as
> occupied/used for the lifetime of SQL CE usage. This is not a memory leak
> but just the preallocated buffer held by SQL CE. If you want to change
> the parameters that affect the shared memory, please look at Books Online.
> Note that, decresing buffer pool preallocation size affects performance.
Yes, I knew that... and that's why I don't touch such parameters, since I
know that may be worse than the illness :-P Current devices have enough
storage space to deal with the configuration SQL CE needs. The biggest
problem I still see in Windows Mobile is the process memory limit. We've had
to split some applications into two to avoid this problem. It seems to be
present in WM6 too, so we'll have to wait for a definitive solution.
These are the OLEDB parameters and values I set in the command:
DBPROP_IRowsetChange = VARIANT_FALSE
DBPROP_BOOKMARKS = VARIANT_FALSE
DBPROP_OWNUPDATEDELETE = VARIANT_TRUE
DBPROP_OWNINSERT =VARIANT_TRUE
DBPROP_OTHERUPDATEDELETE =VARIANT_TRUE
DBPROP_OTHERINSERT =VARIANT_TRUE
DBPROP_QUICKRESTART =VARIANT_FALSE
DBPROP_CANFETCHBACKWARDS =VARIANT_TRUE
DBPROP_CANSCROLLBACKWARDS=VARIANT_TRUE
DBPROP_IRowsetUpdate =VARIANT_FALSE
DBPROP_UPDATABILITY =0
I know some of these properties are not honored by the driver, but in those
cases, setting them has just no effect.
Thank you very much in advance...