Showing posts with label merge. Show all posts
Showing posts with label merge. 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 ?

Sunday, February 19, 2012

Broken merge. Need help.

Hi,
Seems I found how to brake merge replication.
Actually I reproduced this situation on my test env. after we found it on
production.
OK we have SQL2K EE SP3a on W2k AE SP4.
Suppose You create a table with few fields of different type
(field1,field2,field3.etc.. rowguid)
Then you publish it for merge replication an push the subscription to
subscriber (with initialization).
Everything works fine.
Then suppose you need to ALTER one of columns (let's say field2) in that
table (char(12 ->char(20))
In merge (or whatever) you have to do sp_repldropcolumn then
sp_repladdcolumn and restore data of that column on publisher.
All changes are done and synchronized with the subscriber. Everything still
works.
Then you create a new merge publication including the same table and push it
to another subscriber (with initialization).
After we found that changes are not correctly transferred between two
subscribers. All data is still correct at the publisher but at the
subscribers some fields are different.
Does anyone know about this? Or any suggestions how to resolve this problem?
Thank You
Darius T.
Hi Darius,
Try looking at the .sch file created by the publication. It is usually
located at: ...\MSSQL\REPLDATA\name_of_publication. I have dealt with cases
that the snapshot file for the creation of the table was not correctly
created. You can manually modify this file to create the correct table with
the correct columns. When the initialization takes place, it will take this
file and apply it tio the subscribers. Hope this helps!
-Jose Molina
"Darius T." <dta@.takas.lt> wrote in message
news:%23s$CB3Z$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi,
> Seems I found how to brake merge replication.
> Actually I reproduced this situation on my test env. after we found it on
> production.
> OK we have SQL2K EE SP3a on W2k AE SP4.
> Suppose You create a table with few fields of different type
> (field1,field2,field3.etc.. rowguid)
> Then you publish it for merge replication an push the subscription to
> subscriber (with initialization).
> Everything works fine.
> Then suppose you need to ALTER one of columns (let's say field2) in that
> table (char(12 ->char(20))
> In merge (or whatever) you have to do sp_repldropcolumn then
> sp_repladdcolumn and restore data of that column on publisher.
> All changes are done and synchronized with the subscriber. Everything
> still works.
> Then you create a new merge publication including the same table and push
> it to another subscriber (with initialization).
> After we found that changes are not correctly transferred between two
> subscribers. All data is still correct at the publisher but at the
> subscribers some fields are different.
> Does anyone know about this? Or any suggestions how to resolve this
> problem?
> Thank You
> Darius T.
>
>
|||> After we found that changes are not correctly transferred between two
> subscribers. All data is still correct at the publisher but at the
> subscribers some fields are different.
Could you be more specific about this situation ?
What do you mean with "some fields are different." ?
Are you making inserts/updates only on publisher ?
Is replication working properly (replicating data to both subscribers) if
you skip step 2 (alter of the column) ?
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"Darius T." <dta@.takas.lt> wrote in message
news:%23s$CB3Z$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi,
> Seems I found how to brake merge replication.
> Actually I reproduced this situation on my test env. after we found it on
> production.
> OK we have SQL2K EE SP3a on W2k AE SP4.
> Suppose You create a table with few fields of different type
> (field1,field2,field3.etc.. rowguid)
> Then you publish it for merge replication an push the subscription to
> subscriber (with initialization).
> Everything works fine.
> Then suppose you need to ALTER one of columns (let's say field2) in that
> table (char(12 ->char(20))
> In merge (or whatever) you have to do sp_repldropcolumn then
> sp_repladdcolumn and restore data of that column on publisher.
> All changes are done and synchronized with the subscriber. Everything
still
> works.
> Then you create a new merge publication including the same table and push
it
> to another subscriber (with initialization).
> After we found that changes are not correctly transferred between two
> subscribers. All data is still correct at the publisher but at the
> subscribers some fields are different.
> Does anyone know about this? Or any suggestions how to resolve this
problem?
> Thank You
> Darius T.
>
>
|||"Some field are differnet" means that if you make update on a record at
publisher and run merge agents to both subscribers You find that all data is
correct only at subscriber 2, but at subscriber 1 data in some fiels in not
updated correctly. (INSERT,DELETE statements work properly).
The same things happening when you make an update on subscriber 2. Data is
merged correctly with publisher but not with subscriber 1.
I could post a step by step script here to see how it happens (if you are
interested)
Darius
P.S. gal galime susirayti ir lietuvikai jei k.
"Kestutis Adomavicius" <kicker.lt@.nospaamm_tut.by> wrote in message
news:%232dPB%23s$EHA.2444@.TK2MSFTNGP10.phx.gbl...
> Could you be more specific about this situation ?
> What do you mean with "some fields are different." ?
> Are you making inserts/updates only on publisher ?
> Is replication working properly (replicating data to both subscribers) if
> you skip step 2 (alter of the column) ?
> --
> Regards,
> Kestutis Adomavicius
> Consultant
> UAB "Baltic Software Solutions"
>
> "Darius T." <dta@.takas.lt> wrote in message
> news:%23s$CB3Z$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> still
> it
> problem?
>
|||Thanks, Jose,
I've checked those .sch scripts. Didn't find any problem.
Darius
"Jose Molina" <rcmaniac23@.yahoo.com> wrote in message
news:OCHeF8k$EHA.3840@.tk2msftngp13.phx.gbl...
> Hi Darius,
> Try looking at the .sch file created by the publication. It is usually
> located at: ...\MSSQL\REPLDATA\name_of_publication. I have dealt with
> cases that the snapshot file for the creation of the table was not
> correctly created. You can manually modify this file to create the
> correct table with the correct columns. When the initialization takes
> place, it will take this file and apply it tio the subscribers. Hope this
> helps!
> -Jose Molina
>
> "Darius T." <dta@.takas.lt> wrote in message
> news:%23s$CB3Z$EHA.1452@.TK2MSFTNGP11.phx.gbl...
>

Friday, February 10, 2012

BorderStyle not shown as Solid for Top ,Bottom & Right side of Reports.

HI ,

Although I am setting the Border Style for each & every cell and /or Merge cells ,But it is not reflected in the Reports Pre-view for Bottom ,Top & Right Sides in the Reports?Any clue why this is happening & for removing this & getting the right results would be helpful .

Thanks

I had an issue where the BorderStyle did not seem to change. I was attempting to set the border to None on the Bottom of a cell but did not change the BorderStyle of the cell below it. Once I changed the Top BorderStyle to None of the cell below then I saw the desired affect.

Hope this helps.