Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Sunday, March 11, 2012

Bug in SQL Server 2005 CE ?

Hello,

I have some trouble with using Merge replication with SQL CE 3.0 (SQL Server 2005 CE).

I've develop a framework that make transition between SQL CE and Business Object (generic framework that use XML for mapping).

My trouble is that I can't upgrade SQL and so use merge replication or the reverse (replication and so upgrade)
When I did this, Visual Studio shows me that I lost connection with the PDA, and on the PDA, I see the error reporting that ask me if I want to send it to Microsoft... (the report contains only number of version and lot of hexadecimal code)
I have no Exception on Visual Studio that I can use for debug this trouble...

Whereas, when I launch this application, I did a merge replication, and stop the program. I relaunch it and make Upgrade And it's work.... (the reverse too)

I check in my code if I forgot to close connection on SQL Ce or else but I didn't find anything...

Anyone have already see this bug ? Or/And have you a pist for resolve it ?

For information:
I use :
SQL Server 2005 Compact Edition (Sql Ce 3.0)
SQL Server 2005 Standard or Entreprise SP1 on Windows Server 2003 (on Virtual Machine)
Compact Framework 2
Windows Mobile 5 and 6 on Emulator
To see if the trouble is cause by my framework, I try to take out the use of my framework and put a easy code.

But the result is the same... I can't make an update + replication.

Here my code :

First, this occur when I press the first button (update) :

Cursor.Current = Cursors.WaitCursor;
SqlCeConnection _conn = new SqlCeConnection(connexionstring);
_conn.Open();
SqlCeCommand _comm = _conn.CreateCommand();
string _req = "UPDATE Employee SET LastName = 'Damien' WHERE EmployeeID = '1'";
_comm.CommandText = _req;
_comm.CommandType = CommandType.Text;
_comm.ExecuteNonQuery();
_comm.Dispose();
_conn.Close();
_conn.Dispose();
Cursor.Current = Cursors.Default;

And now, the second button (Replicate) :

Cursor.Current = Cursors.WaitCursor;
SqlCeReplication repl = new SqlCeReplication();
repl.InternetUrl = @."http://192.168.0.1/Publication/sqlcesa30.dll";
repl.Publisher = @."w2003Mobile";
repl.PublisherDatabase = @."Prototype";
repl.PublisherSecurityMode = SecurityType.NTAuthentication;
repl.Publication = @."PubliProto";
repl.Subscriber = @."Subscription";
repl.SubscriberConnectionString = connexionstring;
try
{
repl.Synchronize(); //Bien dans un Try/Catch mais je n'obtiens pas d'exception..... juste le rapport d'erreur
}
catch (Exception ex)
{
throw new Exception("Erreur lors de la synchronisation", ex);
}
repl.Dispose();
Cursor.Current = Cursors.Default;

As when I test my framework, this code works when I try it separately (with shutdown of my application between two).
But when I try to Update and next Replicate, or reverse, it show me an error report...

I don't know why I've this probleme, so if someone can help me Smile
|||Nobody have some idea ?

Sad

I post 2 pictures that shows the error report :

Note the value of the API Cur Process is strange, isn't it ?

Wednesday, March 7, 2012

Bug in CASE statement?

(SQL Server 2000, SP3a)
Hello all!
I'm trying to "seed" some random data in a table, and am having some trouble with the CASE
statement that I don't fully understand.
Consider the following:
select id,
[Rating] = case (abs(convert(int, convert(varbinary(4), newid())) % 5))
when 0 then NULL
when 1 then 'Poor'
when 2 then 'Fair'
when 3 then 'Good'
when 4 then 'Excellent'
else '?'
end
from sysobjects
I would expect this to return values in the range of 0-4, which would map to the various
strings that you see. However, I keep getting a high incidence of '?' strings returned.
When I use the exact same expression without the CASE statement:
select distinct Rating
from (
select Rating = abs(convert(int, convert(varbinary(4), newid())) % 5)
from sysobjects
) as q
I show that, indeed, the only values that are returned are 0-4.
This sure *seems* like a bug to me, but I suspect the problem lies in my understanding of
the CASE statement.
Any help would be much appreciated! :-)
John PetersonHi John
The only problem you are having with CASE is your terminology. CASE is an
expression, not a statement. But since you are using it as an expression,
within the SELECT statement, you do seem to understand it.
This is very strange behavior indeed. I think the problem is with NEWID().
You can establish that your understanding of the CASE expression by changing
NEWID() to something else, like id from the sysobjects table (and I am also
returning the value computed by the case expression for comparison
purposes):
select id,abs(convert(int, convert(varbinary(4), id)) % 5),
[Rating] = case (abs(convert(int, convert(varbinary(4), id)) % 5))
when 0 then NULL
when 1 then 'Poor'
when 2 then 'Fair'
when 3 then 'Good'
when 4 then 'Excellent'
else '?'
end
from sysobjects
The above seems to work as expected.
My guess is that NEWID() is being regenerated for EVERY comparison, so the
value is always changing. So your expression abs(convert(int,
convert(varbinary(4), id)) % 5) is evaluated and compared to 0, and if so,
NULL is returned, otherwise the expression is evaluted AGAIN (with a new
NEWID() ) and that is compared to 1, and if that one wasn't equal to one,
another NEWID() expression is compared to 2, etc. So it's hardly surprising
that few of the expressions will match the constant you're comparing too
(although a few will) and many will have no match and fall through to '?'
Why don't you tell us exactly what you're trying to do, and someone may have
another suggestion for you.
In the meantime, I'll try to find out what's happening with NEWID() here.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:eaQO0ZzkDHA.976@.tk2msftngp13.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello all!
> I'm trying to "seed" some random data in a table, and am having some
trouble with the CASE
> statement that I don't fully understand.
> Consider the following:
>
> select id,
> [Rating] = case (abs(convert(int, convert(varbinary(4), newid())) %
5))
> when 0 then NULL
> when 1 then 'Poor'
> when 2 then 'Fair'
> when 3 then 'Good'
> when 4 then 'Excellent'
> else '?'
> end
> from sysobjects
>
> I would expect this to return values in the range of 0-4, which would map
to the various
> strings that you see. However, I keep getting a high incidence of '?'
strings returned.
>
> When I use the exact same expression without the CASE statement:
>
> select distinct Rating
> from (
> select Rating = abs(convert(int, convert(varbinary(4), newid())) %
5)
> from sysobjects
> ) as q
>
> I show that, indeed, the only values that are returned are 0-4.
> This sure *seems* like a bug to me, but I suspect the problem lies in my
understanding of
> the CASE statement.
> Any help would be much appreciated! :-)
> John Peterson
>|||Hello, Kalen! Please see inline:
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:ubXkerzkDHA.3312@.tk2msftngp13.phx.gbl...
> Hi John
> The only problem you are having with CASE is your terminology. CASE is an
> expression, not a statement. But since you are using it as an expression,
> within the SELECT statement, you do seem to understand it.
Thanks -- I always want to use the correct nomenclature. I bet if I would have looked in
BOL, I might have used the right term. :-)
> This is very strange behavior indeed. I think the problem is with NEWID().
> You can establish that your understanding of the CASE expression by changing
> NEWID() to something else, like id from the sysobjects table (and I am also
> returning the value computed by the case expression for comparison
> purposes):
> select id,abs(convert(int, convert(varbinary(4), id)) % 5),
> [Rating] = case (abs(convert(int, convert(varbinary(4), id)) % 5))
> when 0 then NULL
> when 1 then 'Poor'
> when 2 then 'Fair'
> when 3 then 'Good'
> when 4 then 'Excellent'
> else '?'
> end
> from sysobjects
> The above seems to work as expected.
Yeah, that's exactly what I wound up doing in my table, since the IDs were GUIDs, I didn't
necessarily need to use newid().
> My guess is that NEWID() is being regenerated for EVERY comparison, so the
> value is always changing. So your expression abs(convert(int,
> convert(varbinary(4), id)) % 5) is evaluated and compared to 0, and if so,
> NULL is returned, otherwise the expression is evaluted AGAIN (with a new
> NEWID() ) and that is compared to 1, and if that one wasn't equal to one,
> another NEWID() expression is compared to 2, etc. So it's hardly surprising
> that few of the expressions will match the constant you're comparing too
> (although a few will) and many will have no match and fall through to '?'
Oh, interesting! I guess that sort of makes sense if the "internals" of the execution are
always re-evaluating NEWID() instead of just having one persistent value.
> Why don't you tell us exactly what you're trying to do, and someone may have
> another suggestion for you.
> In the meantime, I'll try to find out what's happening with NEWID() here.
All I really wanted to do was generate some random data -- and I tried using the RAND()
function, but it would only evaluate RAND() *once* for every row in the result set (just
like GETDATE() does, I believe); as such, every value was the same. So, I switched to use
NEWID(), since that appears to generate a new value for each row in the result set.
At this point, I was able to use a variant of your suggestion (to use a static value
instead of NEWID()) to generate my random data. But, I thought it would be worth posting
this issue to try and find out more about it. :-)
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "John Peterson" <j0hnp@.comcast.net> wrote in message
> news:eaQO0ZzkDHA.976@.tk2msftngp13.phx.gbl...
> > (SQL Server 2000, SP3a)
> >
> > Hello all!
> >
> > I'm trying to "seed" some random data in a table, and am having some
> trouble with the CASE
> > statement that I don't fully understand.
> >
> > Consider the following:
> >
> >
> > select id,
> > [Rating] = case (abs(convert(int, convert(varbinary(4), newid())) %
> 5))
> > when 0 then NULL
> > when 1 then 'Poor'
> > when 2 then 'Fair'
> > when 3 then 'Good'
> > when 4 then 'Excellent'
> > else '?'
> > end
> > from sysobjects
> >
> >
> > I would expect this to return values in the range of 0-4, which would map
> to the various
> > strings that you see. However, I keep getting a high incidence of '?'
> strings returned.
> >
> >
> > When I use the exact same expression without the CASE statement:
> >
> >
> > select distinct Rating
> > from (
> > select Rating = abs(convert(int, convert(varbinary(4), newid())) %
> 5)
> > from sysobjects
> > ) as q
> >
> >
> > I show that, indeed, the only values that are returned are 0-4.
> >
> > This sure *seems* like a bug to me, but I suspect the problem lies in my
> understanding of
> > the CASE statement.
> >
> > Any help would be much appreciated! :-)
> >
> > John Peterson
> >
> >
>|||Yes, this is an useful distinction between RAND() and NEWID(). I knew
NEWID() regenerated for each row, but it sure seems strange that it would
reevaluate for every comparison within a CASE.
But it's probably good to know this!
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:uBnY#xzkDHA.2312@.TK2MSFTNGP12.phx.gbl...
> Hello, Kalen! Please see inline:
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:ubXkerzkDHA.3312@.tk2msftngp13.phx.gbl...
> > Hi John
> > The only problem you are having with CASE is your terminology. CASE is
an
> > expression, not a statement. But since you are using it as an
expression,
> > within the SELECT statement, you do seem to understand it.
> Thanks -- I always want to use the correct nomenclature. I bet if I would
have looked in
> BOL, I might have used the right term. :-)
>
> > This is very strange behavior indeed. I think the problem is with
NEWID().
> > You can establish that your understanding of the CASE expression by
changing
> > NEWID() to something else, like id from the sysobjects table (and I am
also
> > returning the value computed by the case expression for comparison
> > purposes):
> >
> > select id,abs(convert(int, convert(varbinary(4), id)) % 5),
> > [Rating] = case (abs(convert(int, convert(varbinary(4), id)) %
5))
> > when 0 then NULL
> > when 1 then 'Poor'
> > when 2 then 'Fair'
> > when 3 then 'Good'
> > when 4 then 'Excellent'
> > else '?'
> > end
> > from sysobjects
> >
> > The above seems to work as expected.
> Yeah, that's exactly what I wound up doing in my table, since the IDs were
GUIDs, I didn't
> necessarily need to use newid().
>
> > My guess is that NEWID() is being regenerated for EVERY comparison, so
the
> > value is always changing. So your expression abs(convert(int,
> > convert(varbinary(4), id)) % 5) is evaluated and compared to 0, and if
so,
> > NULL is returned, otherwise the expression is evaluted AGAIN (with a new
> > NEWID() ) and that is compared to 1, and if that one wasn't equal to
one,
> > another NEWID() expression is compared to 2, etc. So it's hardly
surprising
> > that few of the expressions will match the constant you're comparing too
> > (although a few will) and many will have no match and fall through to
'?'
> Oh, interesting! I guess that sort of makes sense if the "internals" of
the execution are
> always re-evaluating NEWID() instead of just having one persistent value.
>
> > Why don't you tell us exactly what you're trying to do, and someone may
have
> > another suggestion for you.
> > In the meantime, I'll try to find out what's happening with NEWID()
here.
> All I really wanted to do was generate some random data -- and I tried
using the RAND()
> function, but it would only evaluate RAND() *once* for every row in the
result set (just
> like GETDATE() does, I believe); as such, every value was the same. So, I
switched to use
> NEWID(), since that appears to generate a new value for each row in the
result set.
> At this point, I was able to use a variant of your suggestion (to use a
static value
> instead of NEWID()) to generate my random data. But, I thought it would
be worth posting
> this issue to try and find out more about it. :-)
>
> > --
> > HTH
> > --
> > Kalen Delaney
> > SQL Server MVP
> > www.SolidQualityLearning.com
> >
> >
> > "John Peterson" <j0hnp@.comcast.net> wrote in message
> > news:eaQO0ZzkDHA.976@.tk2msftngp13.phx.gbl...
> > > (SQL Server 2000, SP3a)
> > >
> > > Hello all!
> > >
> > > I'm trying to "seed" some random data in a table, and am having some
> > trouble with the CASE
> > > statement that I don't fully understand.
> > >
> > > Consider the following:
> > >
> > >
> > > select id,
> > > [Rating] = case (abs(convert(int, convert(varbinary(4),
newid())) %
> > 5))
> > > when 0 then NULL
> > > when 1 then 'Poor'
> > > when 2 then 'Fair'
> > > when 3 then 'Good'
> > > when 4 then 'Excellent'
> > > else '?'
> > > end
> > > from sysobjects
> > >
> > >
> > > I would expect this to return values in the range of 0-4, which would
map
> > to the various
> > > strings that you see. However, I keep getting a high incidence of '?'
> > strings returned.
> > >
> > >
> > > When I use the exact same expression without the CASE statement:
> > >
> > >
> > > select distinct Rating
> > > from (
> > > select Rating = abs(convert(int, convert(varbinary(4),
newid())) %
> > 5)
> > > from sysobjects
> > > ) as q
> > >
> > >
> > > I show that, indeed, the only values that are returned are 0-4.
> > >
> > > This sure *seems* like a bug to me, but I suspect the problem lies in
my
> > understanding of
> > > the CASE statement.
> > >
> > > Any help would be much appreciated! :-)
> > >
> > > John Peterson
> > >
> > >
> >
> >
>|||Hello
> select id,
> [Rating] = case (abs(convert(int, convert(varbinary(4), newid())) %
5))
> when 0 then NULL
> when 1 then 'Poor'
> when 2 then 'Fair'
> when 3 then 'Good'
> when 4 then 'Excellent'
> else '?'
> end
> from sysobjects
>
> I would expect this to return values in the range of 0-4, which would map
to the various
> strings that you see. However, I keep getting a high incidence of '?'
strings returned.
What version of SQL server are you using?
I've tested your query on my MSSQL 2000 EE + SP3 and it works fine.
Number of '?' is near the number of other variants.
Serge Shakhov|||That's just it -- there should be *no* '?' results. (I'm using SQL 2000 EE SP3a.)
"Serge Shakhov" <REMOVETHIS_ACETYLENE@.mail.ru> wrote in message
news:q0ilmb.039.ln@.proxyserver.ctd.mmk.chel.su...
> Hello
> > select id,
> > [Rating] = case (abs(convert(int, convert(varbinary(4), newid())) %
> 5))
> > when 0 then NULL
> > when 1 then 'Poor'
> > when 2 then 'Fair'
> > when 3 then 'Good'
> > when 4 then 'Excellent'
> > else '?'
> > end
> > from sysobjects
> >
> >
> > I would expect this to return values in the range of 0-4, which would map
> to the various
> > strings that you see. However, I keep getting a high incidence of '?'
> strings returned.
> What version of SQL server are you using?
> I've tested your query on my MSSQL 2000 EE + SP3 and it works fine.
> Number of '?' is near the number of other variants.
>
> Serge Shakhov
>

Saturday, February 25, 2012

buffer cache hit ratio estimation

Hi
I have trouble with MSSQL2000 SP4 (without any hotfixes). During last two
weeks it start works anormally. After last optimalization (about few months
ago) it works good (fast, without blocks). Its buffer cache hit ratio was
about 99.7-99.8. Last day it starts work slow, there was many blocks and
dedlocks. There are no any queries, jobs and applications was added. Now
buffer cache hit ratio oscilate about 95-98. I try update statistics and
reindex some hard used tables, but there is no effect or effect is wery
short (after few hours problem return).
Mayby somene know what it could be?
Is it possible to estimate how each table (using DBCC SHOW_STATISTICS or
DBCC SHOWCONTIG or others) how the table affect on total buffer cache hit
ratio?
Marek
--
www.programowanieobiektowe.plChances are you are now scanning a table(s) where as before you were doing
seeks. You need to profile the queries to see which are the poorly
performing ones (ones with high duration and reads) and address why.
Andrew J. Kelly SQL MVP
"Marek Wierzbicki" <marek.wierzbickiiiii@.azymuttttt.pl> wrote in message
news:ed8rmq$1h4p$1@.news2.ipartners.pl...
> Hi
> I have trouble with MSSQL2000 SP4 (without any hotfixes). During last two
> weeks it start works anormally. After last optimalization (about few
> months ago) it works good (fast, without blocks). Its buffer cache hit
> ratio was about 99.7-99.8. Last day it starts work slow, there was many
> blocks and dedlocks. There are no any queries, jobs and applications was
> added. Now buffer cache hit ratio oscilate about 95-98. I try update
> statistics and reindex some hard used tables, but there is no effect or
> effect is wery short (after few hours problem return).
> Mayby somene know what it could be?
> Is it possible to estimate how each table (using DBCC SHOW_STATISTICS or
> DBCC SHOWCONTIG or others) how the table affect on total buffer cache hit
> ratio?
> Marek
> --
> www.programowanieobiektowe.pl|||> Chances are you are now scanning a table(s) where as before you were doing
> seeks. You need to profile the queries to see which are the poorly
> performing ones (ones with high duration and reads) and address why.
profiler didn't show any long time and expansive queries, but some simple
queries work about minute (not secounds like earlier)
Marek|||Then you need to find out why. Are there high disk queues? High CPU? Is
there blocking for those queries? You have to narrow it down so you can
start addressing the real issue. Maybe these will help:
http://www.sql-server-performance.com/sql_server_performance_audit10.asp
Performance Audit
http://www.microsoft.com/technet/prodtechnol/sql/2005/library/operations.mspx
Performance WP's
http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
http://www.sql-server-performance.com/sql_server_performance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.com/best_sql_server_performance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_perfmon_24u1.asp
Disk Monitoring
http://sqldev.net/misc/WaitTypes.htm Wait Types
Tempdb in 2005:
http://download.microsoft.com/download/4/f/8/4f8f2dc9-a9a7-4b68-98cb-163482c95e0b/WorkingWithTempDB.doc
Physical Database Storage:
http://download.microsoft.com/download/4/f/8/4f8f2dc9-a9a7-4b68-98cb-163482c95e0b/PhysDBStor.doc
--
Andrew J. Kelly SQL MVP
"Marek Wierzbicki" <marek.wierzbickiiiii@.azymuttttt.pl> wrote in message
news:edh8j6$4jj$1@.news2.ipartners.pl...
>> Chances are you are now scanning a table(s) where as before you were
>> doing seeks. You need to profile the queries to see which are the poorly
>> performing ones (ones with high duration and reads) and address why.
> profiler didn't show any long time and expansive queries, but some simple
> queries work about minute (not secounds like earlier)
>
> Marek
>|||> Then you need to find out why. Are there high disk queues? High CPU? Is
> there blocking for those queries? You have to narrow it down so you can
> start addressing the real issue. Maybe these will help:
I will try Your links. during hi trouble periods disk quees is over 50-60
Marek

buffer cache hit ratio estimation

Hi
I have trouble with MSSQL2000 SP4 (without any hotfixes). During last two
weeks it start works anormally. After last optimalization (about few months
ago) it works good (fast, without blocks). Its buffer cache hit ratio was
about 99.7-99.8. Last day it starts work slow, there was many blocks and
dedlocks. There are no any queries, jobs and applications was added. Now
buffer cache hit ratio oscilate about 95-98. I try update statistics and
reindex some hard used tables, but there is no effect or effect is wery
short (after few hours problem return).
Mayby somene know what it could be?
Is it possible to estimate how each table (using DBCC SHOW_STATISTICS or
DBCC SHOWCONTIG or others) how the table affect on total buffer cache hit
ratio?
Marek
www.programowanieobiektowe.plChances are you are now scanning a table(s) where as before you were doing
seeks. You need to profile the queries to see which are the poorly
performing ones (ones with high duration and reads) and address why.
Andrew J. Kelly SQL MVP
"Marek Wierzbicki" <marek.wierzbickiiiii@.azymuttttt.pl> wrote in message
news:ed8rmq$1h4p$1@.news2.ipartners.pl...
> Hi
> I have trouble with MSSQL2000 SP4 (without any hotfixes). During last two
> weeks it start works anormally. After last optimalization (about few
> months ago) it works good (fast, without blocks). Its buffer cache hit
> ratio was about 99.7-99.8. Last day it starts work slow, there was many
> blocks and dedlocks. There are no any queries, jobs and applications was
> added. Now buffer cache hit ratio oscilate about 95-98. I try update
> statistics and reindex some hard used tables, but there is no effect or
> effect is wery short (after few hours problem return).
> Mayby somene know what it could be?
> Is it possible to estimate how each table (using DBCC SHOW_STATISTICS or
> DBCC SHOWCONTIG or others) how the table affect on total buffer cache hit
> ratio?
> Marek
> --
> www.programowanieobiektowe.pl|||> Chances are you are now scanning a table(s) where as before you were doing
> seeks. You need to profile the queries to see which are the poorly
> performing ones (ones with high duration and reads) and address why.
profiler didn't show any long time and expansive queries, but some simple
queries work about minute (not secounds like earlier)
Marek|||Then you need to find out why. Are there high disk queues? High CPU? Is
there blocking for those queries? You have to narrow it down so you can
start addressing the real issue. Maybe these will help:
http://www.sql-server-performance.c...nce_audit10.asp
Performance Audit
http://www.microsoft.com/technet/pr...perfmonitor.asp Perfmon counters
http://www.sql-server-performance.c...mance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.c...rmance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/d.../>
on_24u1.asp
Disk Monitoring
http://sqldev.net/misc/WaitTypes.htm Wait Types
Tempdb in 2005:
http://download.microsoft.com/downl...gWithTempDB.doc
Physical Database Storage:
http://download.microsoft.com/downl...
PhysDBStor.doc
Andrew J. Kelly SQL MVP
"Marek Wierzbicki" <marek.wierzbickiiiii@.azymuttttt.pl> wrote in message
news:edh8j6$4jj$1@.news2.ipartners.pl...
> profiler didn't show any long time and expansive queries, but some simple
> queries work about minute (not secounds like earlier)
>
> Marek
>|||> Then you need to find out why. Are there high disk queues? High CPU? Is
> there blocking for those queries? You have to narrow it down so you can
> start addressing the real issue. Maybe these will help:
I will try Your links. during hi trouble periods disk quees is over 50-60
Marek

Sunday, February 12, 2012

Boy am in big trouble!

I just got finished developing the company intranet site and thinking that everything was working I boasted about how good it was by getting my boss to login and submit a new job to the db (new job, its a work management app) while i did the same, the pland was to hit the submit button at the same time. He would send one to be read by me and I would send one to be read by him. We both hit submit and the following happened.

The db has somehow fused the two into one. I thought maybe we were to accurate in hitting the submit button together. But I even gave a five second delay between and for some reason the job is being overriden by one user tor the other. In other words we are both sharing the same jobid. I thought this could never happen with sql server supposing that it would lock one request until another was completed and vice versa. But I'm so new to this that I'm just so naieve to think that the db would do this for you. Problem is I'm about to move on and I can't leave the app in this state. Can anyone point to some articles or give some suggestions has to my situation. Most desperately in need!!

Thanks in advanceoh crap. that's insane man. what's the db architecture, and are you using procedures to do the transactions? need more info. it shouldn't allow multiple inserts to be merged into one unless you're using a datatable to hold the data, and you're doing that incorrectly.|||In fact, if you want, just aim me in the morning. PST, and I'll help you out then, and post the logs here.|||I use stored procedures and transactions.

Where do i get the logs?|||Nevermind. Actually.. I can't see how this is happening.

In fact, it's impossible unless you're creating the primary key manually, or trying to do something uncommonly complicated, and messed up along the way.|||This is what I'm doing and It makes sense why it doing this but I'm not sure of a solution.

Let me explain.

I have two processes.

I add a job to my db, the job contains a title, date, time etc.

When the user submits it they are returned a job number from the db. They then need to add a note that goes along with the job. This job is stored in a job table

A job can have many notes but they must add at least one, thats the default behaviour. When having submitted the note the details are stored in a note table, its foreign key is the jobid that was returned from the first insert.

IE I can access all the notes by its jobid.

The problem occurs when two people do this

User A : Adds a job

User B : Adds a job

I think user a's jobid is being written over by user b. Therefore when (user a) add a note they are actually submitting the note to the jobid of user b.

Now thats my hunch. And it certainly explains the behaviour. Problem is that I can't really afford to change the structure of the entire thing right now. What would really help is if I was able to prevent (user a's) job number from being over written. I'm using static vars.

Any suggestions would be most helpful!!|||dont you have a username/userid column tht you can use to differentiate among users ?|||I'm going to go on a limb, and assume the JobID foriegn key is an int - Identity with an increment seed of 1 right?|||I found the problem and it had nothing to do with my db. I was using a property to store my jobid, which meant that the last person to add a new job would be overwritting the previous persons job id. If user a had'nt submitted is note before user b added a new job the user a's job id would be overwritten by users b's. So user a would be submitting a note with a foreign keys from user b.

Now I know what going on I am kinda on the road to recovery.

I just need to figure out what kind of variable I can use to persist a jobid across different users so they don't overwrite one another. I'm thinking session variables. But I'm so new at this I'm not sure if theres a better way?|||property? you aren't creating a new instance of the object, and sharing it between multiple calls? That's a bit unstable don't you think?|||Sometimes we learn those hard lessons through trial and error.|||I hear ya. :) I've done the same before actually.

this is OT, but hope it makes you feel better... two nights ago, I made a while loop with three nested loops and two methods. Two of the methods work with each other to determine the end of the loop. Let's just say I forgot to set the condition to false. :) Saw my ram go straight to 2gigs of usage from a single process.

And yeah, I've done some pretty interesting things that when looking back now.. I scoff at myself, but you're right, it's a live and learn ordeal.

Good luck in finishing.

Friday, February 10, 2012

Bother switching from MSDE to Access database?

We wrote our .Net 2.0 application using MSDE.
However, the demo programs we have sent out
many times have trouble installing MSDE on the
customer's computer.
We are thinking about converting our database from
MSDE to access because of this practical problem.
The question is this:
Will the sql server 2005 replacement for MSDE have
an easier time installing than MSDE?
thanks in advance
jay
jay w
jay,
I'll let the SQL Server experts here address the installation issues of SQL
Express. My limited experience with Express is that it is an easier install.
But if you're considering Access I thought you might be interested in SQL
Server Compact Edition:
http://www.microsoft.com/downloads/details.aspx?FamilyID=85e0c3ce-3fa1-453a-8ce9-af6ca20946c3&displaylang=en
Although the current download is RC1, release is expected for the first week
in December. Installation can be as simple as copying a few DLLs and a
database is a single file, but you would need to change your .NET 2.0 code
slightly to use the SqlCe namespace rather than SqlClient. SQL Compact also
does not support stored procedures or triggers, but then neither does
Access.
Ginny Caughey
Device Application Development MVP
"jay w" <jayw@.discussions.microsoft.com> wrote in message
news:CBD1EFCA-92AD-49C4-958F-B1CB061DA6CD@.microsoft.com...
> We wrote our .Net 2.0 application using MSDE.
> However, the demo programs we have sent out
> many times have trouble installing MSDE on the
> customer's computer.
> We are thinking about converting our database from
> MSDE to access because of this practical problem.
> The question is this:
> Will the sql server 2005 replacement for MSDE have
> an easier time installing than MSDE?
> thanks in advance
> jay
> --
> jay w
|||For SQL Express the setup has been completely rewritten but it still uses
the Windows installer technology so there are places where it can fail. For
demo purposes you might want to look at SQL Server Compact Edition. It is
smaller and simpler than SQL Express or Access. It doesn't have all the
features of SQL Server Express but it is more compatible than Access would
be.
http://msdn2.microsoft.com/en-us/library/ayee3tzx.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"jay w" <jayw@.discussions.microsoft.com> wrote in message
news:CBD1EFCA-92AD-49C4-958F-B1CB061DA6CD@.microsoft.com...
> We wrote our .Net 2.0 application using MSDE.
> However, the demo programs we have sent out
> many times have trouble installing MSDE on the
> customer's computer.
> We are thinking about converting our database from
> MSDE to access because of this practical problem.
> The question is this:
> Will the sql server 2005 replacement for MSDE have
> an easier time installing than MSDE?
> thanks in advance
> jay
> --
> jay w
|||This article may provide you some pointers about using Unattended
installations with SQL Server.
SQL Server 2005 UnAttended Installations
http://www.devx.com/dbzone/Article/31648
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"jay w" <jayw@.discussions.microsoft.com> wrote in message
news:CBD1EFCA-92AD-49C4-958F-B1CB061DA6CD@.microsoft.com...
> We wrote our .Net 2.0 application using MSDE.
> However, the demo programs we have sent out
> many times have trouble installing MSDE on the
> customer's computer.
> We are thinking about converting our database from
> MSDE to access because of this practical problem.
> The question is this:
> Will the sql server 2005 replacement for MSDE have
> an easier time installing than MSDE?
> thanks in advance
> jay
> --
> jay w