Doubts about changing a replicated database in production

  • Thread starter Anderson Takemitsu Kubota
  • Start date
A

Anderson Takemitsu Kubota

Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so republicate it
again. Right?
But doing this, when I try to synchronize again in the PPC I receive the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
J

Justin Marshall

Hi Anderson,

I regularly remove, change DB and recreate the publication and do not have
any problems (as long as the name of the publication etc. are the same as
before).

You might try checking further into your SqlCeException messages to get a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed" for
a lot of different reasons.

HTH, Justin.
 
K

Kevin Boske - [MS]

Normally the database should not grow to twice its size. Did you add any
data or change any data types before you reinitialized the subscriber?

You should also try using the Compact() method on the database after you
ReInitialize.


Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
----------------------------------------------------------------------------
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
----------------------------------------------------------------------------
----------------------------------------
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.
----------------------------------------------------------------------------
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Wed, 23 Jul 2003 10:43:47 -0300
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:28978
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Justin!

Thanks for your reply.
Should I set the repl.ReinitializeSubscription(true);?
Maybe it's why I am getting error. Now I tried it and the process was ok.
But what I realized it that the database size increased a lot, something
like twice the original size. Is it correct?

Thanks again.

Anderson T. Kubota

Justin Marshall said:
Hi Anderson,

I regularly remove, change DB and recreate the publication and do not have
any problems (as long as the name of the publication etc. are the same as
before).

You might try checking further into your SqlCeException messages to get a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed" for
a lot of different reasons.

HTH, Justin.



Anderson Takemitsu Kubota said:
Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so republicate it
again. Right?
But doing this, when I try to synchronize again in the PPC I receive the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
A

Anderson Takemitsu Kubota

Hi Kevin!

I added none or just one or two small records and one table.
The original size of the database is 2,5Mb. If I do any change in the
database and run the ReInitialize, the database will grow for 5Mb.
If I delete this database and rerun the Synchronize, it'll be again with
2,5Mb.
Moreover, when the ReInitialize() clause is set to true, the synchronization
time takes much more time, because it'll send all the records, in my case
4600 records against 3 records if I don't use the ReInitialize clause.

Please any other help will be great.

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
Normally the database should not grow to twice its size. Did you add any
data or change any data types before you reinitialized the subscriber?

You should also try using the Compact() method on the database after you
ReInitialize.


Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
-------------------------------------------------------------------------- --
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
-------------------------------------------------------------------------- --
----------------------------------------
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.
-------------------------------------------------------------------------- --
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Wed, 23 Jul 2003 10:43:47 -0300
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:28978
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Justin!

Thanks for your reply.
Should I set the repl.ReinitializeSubscription(true);?
Maybe it's why I am getting error. Now I tried it and the process was ok.
But what I realized it that the database size increased a lot, something
like twice the original size. Is it correct?

Thanks again.

Anderson T. Kubota

Justin Marshall said:
Hi Anderson,

I regularly remove, change DB and recreate the publication and do not have
any problems (as long as the name of the publication etc. are the same as
before).

You might try checking further into your SqlCeException messages to get a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed" for
a lot of different reasons.

HTH, Justin.



Anderson Takemitsu Kubota said:
Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so republicate it
again. Right?
But doing this, when I try to synchronize again in the PPC I receive the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
K

Kevin Boske - [MS]

What happens if you compact the database after calling Reinitialize()?
Does it shrink back to ~2.5 mb?

When you call ReInitialize(TRUE), SQL Server CE will send all of the
changed records from the device to the desktop. Have you updated all 4600
records? What are the updates you are making against the SQL Server CE
database (if any)?

Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
----------------------------------------------------------------------------
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
----------------------------------------------------------------------------
----------------------------------------
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.
----------------------------------------------------------------------------
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Thu, 24 Jul 2003 12:26:41 -0300
Lines: 140
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:29117
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Kevin!

I added none or just one or two small records and one table.
The original size of the database is 2,5Mb. If I do any change in the
database and run the ReInitialize, the database will grow for 5Mb.
If I delete this database and rerun the Synchronize, it'll be again with
2,5Mb.
Moreover, when the ReInitialize() clause is set to true, the synchronization
time takes much more time, because it'll send all the records, in my case
4600 records against 3 records if I don't use the ReInitialize clause.

Please any other help will be great.

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
Normally the database should not grow to twice its size. Did you add any
data or change any data types before you reinitialized the subscriber?

You should also try using the Compact() method on the database after you
ReInitialize.


Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
-------------------------------------------------------------------------- --
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
-------------------------------------------------------------------------- --
----------------------------------------
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.
-------------------------------------------------------------------------- --
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Wed, 23 Jul 2003 10:43:47 -0300
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:28978
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Justin!

Thanks for your reply.
Should I set the repl.ReinitializeSubscription(true);?
Maybe it's why I am getting error. Now I tried it and the process was ok.
But what I realized it that the database size increased a lot, something
like twice the original size. Is it correct?

Thanks again.

Anderson T. Kubota

Justin Marshall said:
Hi Anderson,

I regularly remove, change DB and recreate the publication and do not have
any problems (as long as the name of the publication etc. are the same as
before).

You might try checking further into your SqlCeException messages to get a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed" for
a lot of different reasons.

HTH, Justin.



Anderson Takemitsu Kubota said:
Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so republicate it
again. Right?
But doing this, when I try to synchronize again in the PPC I receive the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
A

Anderson Takemitsu Kubota

Hi Kevin!

I am sending you the code I am using.

internal const string DATABASE_FILE = "";
private const string CONNECTION_STRING = "Data Source = \\Program
Files\\Sales\\Sales.sdf";

SqlCeReplication repl = new SqlCeReplication();
repl.PublisherLogin = g_Global.PublisherLogin;
repl.InternetUrl = g_Global.InternetUrl;
repl.PublisherPassword = g_Global.PublisherPassword;
repl.Publisher = g_Global.Publisher;
repl.InternetLogin = "";
repl.InternetPassword = "";
repl.PublisherDatabase = g_Global.PublisherDatabase;
repl.Publication = g_Global.Publication;
strHostName = m_IDUsuario.ToString();
repl.HostName = strHostName;
repl.PublisherSecurityMode = SecurityType.DBAuthentication;
repl.SubscriberConnectionString = CONNECTION_STRING;
repl.Subscriber = strUsuario;
repl.ReinitializeSubscription(true);
if(!File.Exists(Global.DATABASE_FILE))
{
if(!Directory.Exists(Global.DATABASE_DIR))
Directory.CreateDirectory(Global.DATABASE_DIR);
repl.AddSubscription(AddOption.CreateDatabase);
}
repl.LoginTimeout = 30;
repl.Synchronize();
MessageBox.Show("Synchronization Complete:\n" +
"Publisher changes = " + repl.PublisherChanges.ToString() + "\n" +
"Publisher conflicts = " + repl.PublisherConflicts.ToString() + "\n" +
"Subscriber changes = " +
repl.SubscriberChanges.ToString(),Global.APP_CAPTION,MessageBoxButtons.OK,Me
ssageBoxIcon.Asterisk,MessageBoxDefaultButton.Button1);

With this, all the times I execute the synchronization I receive the 4600
publisher changes, even if I send no changes from the ppc and I do no
changes in the server.
I didnt' try the compact. I'll try it now. But I believe the size will be
the original one again. Is the SqlCeEngine.Compact you are telling me?

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
What happens if you compact the database after calling Reinitialize()?
Does it shrink back to ~2.5 mb?

When you call ReInitialize(TRUE), SQL Server CE will send all of the
changed records from the device to the desktop. Have you updated all 4600
records? What are the updates you are making against the SQL Server CE
database (if any)?

Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
-------------------------------------------------------------------------- --
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
-------------------------------------------------------------------------- --
----------------------------------------
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.
-------------------------------------------------------------------------- --
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Thu, 24 Jul 2003 12:26:41 -0300
Lines: 140
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:29117
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Kevin!

I added none or just one or two small records and one table.
The original size of the database is 2,5Mb. If I do any change in the
database and run the ReInitialize, the database will grow for 5Mb.
If I delete this database and rerun the Synchronize, it'll be again with
2,5Mb.
Moreover, when the ReInitialize() clause is set to true, the synchronization
time takes much more time, because it'll send all the records, in my case
4600 records against 3 records if I don't use the ReInitialize clause.

Please any other help will be great.

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
Normally the database should not grow to twice its size. Did you add any
data or change any data types before you reinitialized the subscriber?

You should also try using the Compact() method on the database after you
ReInitialize.


Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
--------------------------------------------------------------------------
--
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
--------------------------------------------------------------------------
--
----------------------------------------
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.
--------------------------------------------------------------------------
--
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Wed, 23 Jul 2003 10:43:47 -0300
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:28978
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Justin!

Thanks for your reply.
Should I set the repl.ReinitializeSubscription(true);?
Maybe it's why I am getting error. Now I tried it and the process was ok.
But what I realized it that the database size increased a lot, something
like twice the original size. Is it correct?

Thanks again.

Anderson T. Kubota

Justin Marshall said:
Hi Anderson,

I regularly remove, change DB and recreate the publication and do not have
any problems (as long as the name of the publication etc. are the same as
before).

You might try checking further into your SqlCeException messages to
get
a failed"
for
republicate
it
again. Right?
But doing this, when I try to synchronize again in the PPC I receive the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To
solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
A

Anderson Takemitsu Kubota

Kevin,

I tried the compact but I am getting error.
Is this the code I should use?
SqlCeEngine engine = new SqlCeEngine(local_ConnString);
engine.Compact("Data Source = temp.sdf");
if(File.Exists("\\temp.sdf"))
{
File.Delete(Global.DATABASE_FILE);
File.Move("\\temp.sdf",Global.DATABASE_FILE);
}

Thank you.

Anderson T. Kubota

Anderson Takemitsu Kubota said:
Hi Kevin!

I am sending you the code I am using.

internal const string DATABASE_FILE = "";
private const string CONNECTION_STRING = "Data Source = \\Program
Files\\Sales\\Sales.sdf";

SqlCeReplication repl = new SqlCeReplication();
repl.PublisherLogin = g_Global.PublisherLogin;
repl.InternetUrl = g_Global.InternetUrl;
repl.PublisherPassword = g_Global.PublisherPassword;
repl.Publisher = g_Global.Publisher;
repl.InternetLogin = "";
repl.InternetPassword = "";
repl.PublisherDatabase = g_Global.PublisherDatabase;
repl.Publication = g_Global.Publication;
strHostName = m_IDUsuario.ToString();
repl.HostName = strHostName;
repl.PublisherSecurityMode = SecurityType.DBAuthentication;
repl.SubscriberConnectionString = CONNECTION_STRING;
repl.Subscriber = strUsuario;
repl.ReinitializeSubscription(true);
if(!File.Exists(Global.DATABASE_FILE))
{
if(!Directory.Exists(Global.DATABASE_DIR))
Directory.CreateDirectory(Global.DATABASE_DIR);
repl.AddSubscription(AddOption.CreateDatabase);
}
repl.LoginTimeout = 30;
repl.Synchronize();
MessageBox.Show("Synchronization Complete:\n" +
"Publisher changes = " + repl.PublisherChanges.ToString() + "\n" +
"Publisher conflicts = " + repl.PublisherConflicts.ToString() + "\n" +
"Subscriber changes = " +
repl.SubscriberChanges.ToString(),Global.APP_CAPTION,MessageBoxButtons.OK,Me
ssageBoxIcon.Asterisk,MessageBoxDefaultButton.Button1);

With this, all the times I execute the synchronization I receive the 4600
publisher changes, even if I send no changes from the ppc and I do no
changes in the server.
I didnt' try the compact. I'll try it now. But I believe the size will be
the original one again. Is the SqlCeEngine.Compact you are telling me?

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
What happens if you compact the database after calling Reinitialize()?
Does it shrink back to ~2.5 mb?

When you call ReInitialize(TRUE), SQL Server CE will send all of the
changed records from the device to the desktop. Have you updated all 4600
records? What are the updates you are making against the SQL Server CE
database (if any)?

Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
--------------------------------------------------------------------------
--
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
--------------------------------------------------------------------------
--
----------------------------------------
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.
--------------------------------------------------------------------------
--
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Thu, 24 Jul 2003 12:26:41 -0300
Lines: 140
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:29117
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Kevin!

I added none or just one or two small records and one table.
The original size of the database is 2,5Mb. If I do any change in the
database and run the ReInitialize, the database will grow for 5Mb.
If I delete this database and rerun the Synchronize, it'll be again with
2,5Mb.
Moreover, when the ReInitialize() clause is set to true, the synchronization
time takes much more time, because it'll send all the records, in my case
4600 records against 3 records if I don't use the ReInitialize clause.

Please any other help will be great.

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
Normally the database should not grow to twice its size. Did you add any
data or change any data types before you reinitialized the subscriber?

You should also try using the Compact() method on the database after you
ReInitialize.


Kevin Boske
([email protected])
SQL Server CE Team
Microsoft

--------------------------------------------------------------------------

--------------------------------------------------------------------------

--------------------------------------------------------------------------
--
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Wed, 23 Jul 2003 10:43:47 -0300
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:28978
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Justin!

Thanks for your reply.
Should I set the repl.ReinitializeSubscription(true);?
Maybe it's why I am getting error. Now I tried it and the process was ok.
But what I realized it that the database size increased a lot, something
like twice the original size. Is it correct?

Thanks again.

Anderson T. Kubota

Hi Anderson,

I regularly remove, change DB and recreate the publication and do
not
have
any problems (as long as the name of the publication etc. are the
same
as
before).

You might try checking further into your SqlCeException messages to
get
a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed"
for
a lot of different reasons.

HTH, Justin.



Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so
republicate
it
again. Right?
But doing this, when I try to synchronize again in the PPC I
receive
the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To
solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database
without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
A

Anderson Takemitsu Kubota

Justin,

I followed your instructions to get the message errors.
They are:
0 - "Initializing SQL Server Reconciler has failed. [,,,,,]"
1 - "The subscription to publication 'Sales' is invalid."

I would like to remember, as the other e-mails I sent, that the process is
running ok, but using the ReinitializeSubscription that increases a lot the
database size and sends all the informations from the server, even if they
weren't changed.

Thank you.

Anderson T. Kubota



Justin Marshall said:
Hi Anderson,

I regularly remove, change DB and recreate the publication and do not have
any problems (as long as the name of the publication etc. are the same as
before).

You might try checking further into your SqlCeException messages to get a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed" for
a lot of different reasons.

HTH, Justin.



Anderson Takemitsu Kubota said:
Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so republicate it
again. Right?
But doing this, when I try to synchronize again in the PPC I receive the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
K

Kevin Boske - [MS]

Yes, that appears correct, though you may need to make your data source =
"\\temp.sdf;" If you only use "temp.sdf", I believe it will look in the
same directory your application is running in.


What is the error you are recieving?

You say that you are getting 4600 rows, is this the number of rows you have
in the publication?



Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
----------------------------------------------------------------------------
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
----------------------------------------------------------------------------
----------------------------------------
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.
----------------------------------------------------------------------------
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Thu, 24 Jul 2003 17:14:23 -0300
Lines: 289
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:29161
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Kevin,

I tried the compact but I am getting error.
Is this the code I should use?
SqlCeEngine engine = new SqlCeEngine(local_ConnString);
engine.Compact("Data Source = temp.sdf");
if(File.Exists("\\temp.sdf"))
{
File.Delete(Global.DATABASE_FILE);
File.Move("\\temp.sdf",Global.DATABASE_FILE);
}

Thank you.

Anderson T. Kubota

Anderson Takemitsu Kubota said:
Hi Kevin!

I am sending you the code I am using.

internal const string DATABASE_FILE = "";
private const string CONNECTION_STRING = "Data Source = \\Program
Files\\Sales\\Sales.sdf";

SqlCeReplication repl = new SqlCeReplication();
repl.PublisherLogin = g_Global.PublisherLogin;
repl.InternetUrl = g_Global.InternetUrl;
repl.PublisherPassword = g_Global.PublisherPassword;
repl.Publisher = g_Global.Publisher;
repl.InternetLogin = "";
repl.InternetPassword = "";
repl.PublisherDatabase = g_Global.PublisherDatabase;
repl.Publication = g_Global.Publication;
strHostName = m_IDUsuario.ToString();
repl.HostName = strHostName;
repl.PublisherSecurityMode = SecurityType.DBAuthentication;
repl.SubscriberConnectionString = CONNECTION_STRING;
repl.Subscriber = strUsuario;
repl.ReinitializeSubscription(true);
if(!File.Exists(Global.DATABASE_FILE))
{
if(!Directory.Exists(Global.DATABASE_DIR))
Directory.CreateDirectory(Global.DATABASE_DIR);
repl.AddSubscription(AddOption.CreateDatabase);
}
repl.LoginTimeout = 30;
repl.Synchronize();
MessageBox.Show("Synchronization Complete:\n" +
"Publisher changes = " + repl.PublisherChanges.ToString() + "\n" +
"Publisher conflicts = " + repl.PublisherConflicts.ToString() + "\n" +
"Subscriber changes = " +
repl.SubscriberChanges.ToString(),Global.APP_CAPTION,MessageBoxButtons.OK,Me
ssageBoxIcon.Asterisk,MessageBoxDefaultButton.Button1);

With this, all the times I execute the synchronization I receive the 4600
publisher changes, even if I send no changes from the ppc and I do no
changes in the server.
I didnt' try the compact. I'll try it now. But I believe the size will be
the original one again. Is the SqlCeEngine.Compact you are telling me?

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
What happens if you compact the database after calling Reinitialize()?
Does it shrink back to ~2.5 mb?

When you call ReInitialize(TRUE), SQL Server CE will send all of the
changed records from the device to the desktop. Have you updated all 4600
records? What are the updates you are making against the SQL Server CE
database (if any)?

Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
--------------------------------------------------------------------------
--
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
--------------------------------------------------------------------------
--
----------------------------------------
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.
--------------------------------------------------------------------------
--
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Thu, 24 Jul 2003 12:26:41 -0300
Lines: 140
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:29117
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Kevin!

I added none or just one or two small records and one table.
The original size of the database is 2,5Mb. If I do any change in the
database and run the ReInitialize, the database will grow for 5Mb.
If I delete this database and rerun the Synchronize, it'll be again with
2,5Mb.
Moreover, when the ReInitialize() clause is set to true, the synchronization
time takes much more time, because it'll send all the records, in my case
4600 records against 3 records if I don't use the ReInitialize clause.

Please any other help will be great.

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
Normally the database should not grow to twice its size. Did you add any
data or change any data types before you reinitialized the subscriber?

You should also try using the Compact() method on the database after you
ReInitialize.


Kevin Boske
([email protected])
SQL Server CE Team
Microsoft

--------------------------------------------------------------------------

--------------------------------------------------------------------------

--------------------------------------------------------------------------
--
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Wed, 23 Jul 2003 10:43:47 -0300
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:28978
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Justin!

Thanks for your reply.
Should I set the repl.ReinitializeSubscription(true);?
Maybe it's why I am getting error. Now I tried it and the process was ok.
But what I realized it that the database size increased a lot, something
like twice the original size. Is it correct?

Thanks again.

Anderson T. Kubota

Hi Anderson,

I regularly remove, change DB and recreate the publication and do
not
have
any problems (as long as the name of the publication etc. are the
same
as
before).

You might try checking further into your SqlCeException messages to
get
a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed"
for
a lot of different reasons.

HTH, Justin.



Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so
republicate
it
again. Right?
But doing this, when I try to synchronize again in the PPC I
receive
the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To
solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database
without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
A

Anderson Takemitsu Kubota

Kevin,

I'll tell you all the steps I've been trying:

Without the repl.ReinitializeSubscription(true):
1. I deleted the local database and did the synchronization.
Result: Publisher changes = 4677
Publisher conflicts = 0
Subscriber changes = 0
Database size = 2,89 Mb

2. I rerun the synchronization
Result: Publisher changes = 0
Publisher conflicts = 0
Subscriber changes = 0
Database size = 2,89 Mb
(good, this is exactly the situation I want to reach)

With the repl.ReinitializeSubscription(true):
3. First, using the same database above.
Result: Publisher changes = 4677
Publisher conflicts = 0
Subscriber changes = 0
Database size = 5,66 Mb
4. Running again the process with no changes.
Result: Publisher changes = 4677
Publisher conflicts = 0
Subscriber changes = 0
Database size = 5,66 Mb

Trying the Compact, I've got the following error messages:
0 - "The SQL Server CE database cannot be compacted. [,,,,,]"
1 - "A foreign key value cannot be inserted because a corresponding primary
key value does not exist. [,,,Primary key constraint name,,]"

I've just read your reply for the other e-mail that I answered for Justin,
and let me see if I understood:
1. I do need to have the ReinitializeSubscription(true) if I want to be sure
that I can do changes on the production database and don't loose any
information in the ppc.
2. Doing this, I will have all the records in the server being sent again
(in my case 4677 records).

I'll wait your position.

Thank you.

Anderson T. Kubota




"Kevin Boske - [MS]" said:
Yes, that appears correct, though you may need to make your data source =
"\\temp.sdf;" If you only use "temp.sdf", I believe it will look in the
same directory your application is running in.


What is the error you are recieving?

You say that you are getting 4600 rows, is this the number of rows you have
in the publication?



Kevin Boske
([email protected])
SQL Server CE Team
Microsoft
-------------------------------------------------------------------------- --
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
-------------------------------------------------------------------------- --
----------------------------------------
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.
-------------------------------------------------------------------------- --
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Thu, 24 Jul 2003 17:14:23 -0300
Lines: 289
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:29161
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Kevin,

I tried the compact but I am getting error.
Is this the code I should use?
SqlCeEngine engine = new SqlCeEngine(local_ConnString);
engine.Compact("Data Source = temp.sdf");
if(File.Exists("\\temp.sdf"))
{
File.Delete(Global.DATABASE_FILE);
File.Move("\\temp.sdf",Global.DATABASE_FILE);
}

Thank you.

Anderson T. Kubota

Anderson Takemitsu Kubota said:
Hi Kevin!

I am sending you the code I am using.

internal const string DATABASE_FILE = "";
private const string CONNECTION_STRING = "Data Source = \\Program
Files\\Sales\\Sales.sdf";

SqlCeReplication repl = new SqlCeReplication();
repl.PublisherLogin = g_Global.PublisherLogin;
repl.InternetUrl = g_Global.InternetUrl;
repl.PublisherPassword = g_Global.PublisherPassword;
repl.Publisher = g_Global.Publisher;
repl.InternetLogin = "";
repl.InternetPassword = "";
repl.PublisherDatabase = g_Global.PublisherDatabase;
repl.Publication = g_Global.Publication;
strHostName = m_IDUsuario.ToString();
repl.HostName = strHostName;
repl.PublisherSecurityMode = SecurityType.DBAuthentication;
repl.SubscriberConnectionString = CONNECTION_STRING;
repl.Subscriber = strUsuario;
repl.ReinitializeSubscription(true);
if(!File.Exists(Global.DATABASE_FILE))
{
if(!Directory.Exists(Global.DATABASE_DIR))
Directory.CreateDirectory(Global.DATABASE_DIR);
repl.AddSubscription(AddOption.CreateDatabase);
}
repl.LoginTimeout = 30;
repl.Synchronize();
MessageBox.Show("Synchronization Complete:\n" +
"Publisher changes = " + repl.PublisherChanges.ToString() + "\n" +
"Publisher conflicts = " + repl.PublisherConflicts.ToString() + "\n" +
"Subscriber changes = " +
repl.SubscriberChanges.ToString(),Global.APP_CAPTION,MessageBoxButtons.OK,Me
ssageBoxIcon.Asterisk,MessageBoxDefaultButton.Button1);

With this, all the times I execute the synchronization I receive the 4600
publisher changes, even if I send no changes from the ppc and I do no
changes in the server.
I didnt' try the compact. I'll try it now. But I believe the size will be
the original one again. Is the SqlCeEngine.Compact you are telling me?

Thank you.

Anderson T. Kubota

"Kevin Boske - [MS]" said:
What happens if you compact the database after calling Reinitialize()?
Does it shrink back to ~2.5 mb?

When you call ReInitialize(TRUE), SQL Server CE will send all of the
changed records from the device to the desktop. Have you updated all 4600
records? What are the updates you are making against the SQL Server CE
database (if any)?

Kevin Boske
([email protected])
SQL Server CE Team
Microsoft

--------------------------------------------------------------------------

--------------------------------------------------------------------------

--------------------------------------------------------------------------
--
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Thu, 24 Jul 2003 12:26:41 -0300
Lines: 140
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:29117
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Kevin!

I added none or just one or two small records and one table.
The original size of the database is 2,5Mb. If I do any change in the
database and run the ReInitialize, the database will grow for 5Mb.
If I delete this database and rerun the Synchronize, it'll be again with
2,5Mb.
Moreover, when the ReInitialize() clause is set to true, the synchronization
time takes much more time, because it'll send all the records, in my case
4600 records against 3 records if I don't use the ReInitialize clause.

Please any other help will be great.

Thank you.

Anderson T. Kubota

Normally the database should not grow to twice its size. Did you
add
any
data or change any data types before you reinitialized the subscriber?

You should also try using the Compact() method on the database after you
ReInitialize.


Kevin Boske
([email protected])
SQL Server CE Team
Microsoft

--------------------------------------------------------------------------
--
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp

--------------------------------------------------------------------------
--
----------------------------------------
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.

--------------------------------------------------------------------------
--
----------------------------------------
--------------------
From: "Anderson Takemitsu Kubota" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: Doubts about changing a replicated database in production
Date: Wed, 23 Jul 2003 10:43:47 -0300
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 200.189.66.138
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:28978
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi Justin!

Thanks for your reply.
Should I set the repl.ReinitializeSubscription(true);?
Maybe it's why I am getting error. Now I tried it and the process
was
ok.
But what I realized it that the database size increased a lot, something
like twice the original size. Is it correct?

Thanks again.

Anderson T. Kubota

Hi Anderson,

I regularly remove, change DB and recreate the publication and do not
have
any problems (as long as the name of the publication etc. are the same
as
before).

You might try checking further into your SqlCeException messages
to
get
a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed"
for
a lot of different reasons.

HTH, Justin.



Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so republicate
it
again. Right?
But doing this, when I try to synchronize again in the PPC I receive
the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed.
[,,,,,].
To
solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database
without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 
J

Justin Marshall

Anderson,

The C# conversion of following code might be worth a try. If the
Synchronisation fails because of an invalid subscription, it reinitialises
and then synchronises.
Probably a better way of detecting an invalid subscription exception but
checking the Message string works for the moment.

HTH, Justin.


Try
rep = New SqlCeReplication( _
gConfig.SyncInternetURL, _
gConfig.SyncInternetUsername, gConfig.SyncInternetPassword, _
gConfig.SyncPublisher, _
gConfig.SyncPublisherDatabase, _
gConfig.SyncPublisherUsername, gConfig.SyncPublisherPassword, _
gConfig.SyncPublication, _
gConfig.SyncSubscriber, _
"Data Source=" & gConfig.DataSource)

If Not File.Exists(gConfig.DataSource) Then
rep.AddSubscription(AddOption.CreateDatabase)
End If

Try

rep.Synchronize()

Catch ex As SqlCeException

If ex.Errors(1).Message.ToLower.IndexOf("subscription to
publication") >= 0 And ex.Errors(1).Message.ToLower.IndexOf("is invalid") >=
0 Then

DisplayMessage("Reinitialising subscription...")
rep.ReinitializeSubscription(True)
rep.Synchronize()

Else
Throw ex
End If

End Try

DisplayMessage("Done")

Catch ex As SqlCeException

DisplayMessage(" Synchronisation error(s):")
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
If ex.Errors(i).NativeError <> 29045 Then
DisplayMessage(" " & i.ToString & ": " &
ex.Errors(i).Message & "(" & ex.Errors(i).HResult & ")")
End If
Next

Catch ex As Exception
DisplayMessage(vbCrLf & "Error:" & ex.Message & vbCrLf)

Finally
If Not rep Is Nothing Then rep.Dispose()
Cursor.Current = Cursors.Default

End Try


Anderson Takemitsu Kubota said:
Justin,

I followed your instructions to get the message errors.
They are:
0 - "Initializing SQL Server Reconciler has failed. [,,,,,]"
1 - "The subscription to publication 'Sales' is invalid."

I would like to remember, as the other e-mails I sent, that the process is
running ok, but using the ReinitializeSubscription that increases a lot the
database size and sends all the informations from the server, even if they
weren't changed.

Thank you.

Anderson T. Kubota



Justin Marshall said:
Hi Anderson,

I regularly remove, change DB and recreate the publication and do not have
any problems (as long as the name of the publication etc. are the same as
before).

You might try checking further into your SqlCeException messages to get a
better idea of the problem.

Catch ex As SqlCeException
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
Messagebox.Show(i.ToString & ": " & ex.Errors(i).Message)
Next

Normally, Errors(1) and beyond have more exact information on what the
problem is. Errors(0) is "Initializing SQL Server Reconciler has failed" for
a lot of different reasons.

HTH, Justin.



Anderson Takemitsu Kubota said:
Hi!

I need to know if I can change a database that is in production.
For this, it's necessary to delete the publication and so republicate it
again. Right?
But doing this, when I try to synchronize again in the PPC I receive the
error message:
cód: 29045 Initializing SQL Server Reconciler has failed. [,,,,,]. To solve
it, I need to delete the local database in the PPC.
Is there any way that I could do changes in my production database without
loosing any information in the PPCs after the new replication?

Am I doing anything wrong?

Thank you.

Anderson T. Kubota
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top