Help With This Replication Questions SQL Mobile

Mar 10, 2008


This customer has an SFA application. They are using NET CF 2.0 SP2, SQL Mobile and Merge Replication with SQL Server 2005. The device they are using are Symbol MC7094. It has integrated phone and is a Windows Mobile 5 Aku 3.

They have set up 5 differents publications for this applications. His business case makes them to have 1 publication to recreate all database structure and the first population of the tables.

For this they use AddSubscription .. Syncronize and the DropSubscription

They use the another 4 publications to sync particular tables because they don€™t want to sync everything, every time. All publications point to the same snapshot.

Each time they want to use one of this publication they instance the SqlceReplication object, then AddSuscription.. Synchronize .. then DropSubscription..

They have one of this publications that use a filter 1=0. Doing the previous steps SQLCE doesn€™t track the change and doesn€™t upload the data of the sql ce table to the server. It seems SQL Server recognize it as a new Sincronization, delete the records of the client and doesn€™t upload the changes (if I don€™t do the DropSubscription it works perfect) I can reproduce that using a device or an emulator.

They have 100 devices via GPRS - VPN. They need to be assure that this Add / DropSubscription will assure they don€™t lose the information. They want to assure all the process of sync is fine just to go to the carrier and make some GPRS connection monitor and test.

How is the best way to approach where the NET CF application needs to use more than one publication to the same database? I have suggested to put all the transactional tables in the same publication but due the business case it is not possible. What are the risks to use many publications?

Another question€¦ each X hours they do a full sync using the first subscription the application returns the next message: The snapshot for this publication has become obsolete. Why this happens? Due the changes in the another publications? How could we manage that to avoid this message? Note: All the test were doing via cradle and GPRS with the same results.

View 3 Replies


ADVERTISEMENT

SQL Server Mobile 2005 Merge Replication Problem On Windows Mobile 5.0

Aug 8, 2006



Dear ppl,

I am writing an application for a device (MDA Pro T-Mobile) having Windows Mobile 5.0 using

-MS .NET Compact Framework 2.0 SP-1
-SQL Mobile 2005.
-VS 2005 .NET

The application uses Merge Replication. The error occurs in the Synchronise() Method of the SqlCeReplication object.

"SQL Server Mobile encountered problems when opening the database."

repl.AddSubscription(AddOption.CreateDatabase);
repl.Synchronize();

I don't understand why I am having this error. It does create the database on AddSubscription() method but it is failing opening the database on Synchronise(). I have also tried uninstalling and then reinstalling all the SQL Mobile components in the following order.

-sqlce30.wce5.armv4i.cab
-sqlce30.repl.wce5.armv4i.cab
-sqlce30.dev.ENU.wce5.armv4i.cab

However, when i run this application on a device(Dell X50 AXIM) with Pocket PC 2003, it runs fine creating the database and sysnchronising it.

The target platform for the project is Windows Mobile 5.0 Pocket PC SDK.

Does any one have any clue what could be the problem ?

Regards
Nabeel

View 6 Replies View Related

SQL Mobile 2005 Replication - SQL Mobile DLL Could Not Be Loaded - Error 28559

Jun 15, 2006

I am migrating a pocket PC application from VS 2003 to VS 2005 and a few weeks ago I hit the following problem when replicating

A SQL Mobile DLL could not be loaded. Reinstall SQL Mobile. [ DLL Name=sqlceca30.dll]

Scanning forums for help I saw that other people had had this problem and one

http://www.eggheadcafe.com/aspnet_answers/NETFrameworkCompactFramework/Feb2006/post25814466.asp

suggested that this problem could be circumvented by getting the replication object early and then continuously using the same object for subsequent replications.

I did this and it works a lot better now but ever so often I get another error which is

Native Error 28559 SQL Mobile encountered problems when opening the database

My only option at this point is to stop and start the application which cures the problem.

View 4 Replies View Related

SQL Server Mobile Merge Replication Walkthrough, Cant Find The .NET Framework Data Provider For SQL Server Mobile Edition.

Sep 9, 2005

Hi,

View 3 Replies View Related

Mobile Replication

Aug 11, 2006

I have the following setup



Server 1: Windows 2003 inc IIS. Also on this server is SQL Server Web sync web service and it has an external IP address for internet connectivity

Server 2: Windows 2003 inc SQL Server 2005. This server has a database setup with replication so the a Window Mobile 5 device can do a merge replication.



My problem is that the replication fails when trying to send the snap shot from Server 2 to the mobile device. The device seems to get through to the replication agent, as entries in the Replication monitor are logged (see below).

I have checked all the permissions on the relevant shares required for replication (basically set "Everyone" with full access).

My initial question would be.... When the snapshot is been sent to the mobile device, does the SQL Server try to send it directly to the internet or does it go through "SQL Server Mobile Server Agent 3.0".

Please can someone help, as this is causing me some REAL problems.

Error messages:
The schema script '\ukrt1-sql902SQLRepluncUKRT1-SQL902_EXEL_DAMAGECODESEXEL20060810142533DamageAction_2.sch'
could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147023570)
Get help: http://help/MSSQL_REPL-2147023570

The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization,
the merge process may have been unable to create or write to the message file. When troubleshooting,
restart the synchronization with verbose history logging and specify an output file to which to write.
(Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001


View 1 Replies View Related

Mobile Replication

Mar 8, 2006

Dear All,

I need to make Sql Server Mobile replication with Sql Server 2005, could any body tell where can I find step by step procedure to make this?

Thanks and Regards

View 5 Replies View Related

Replication With Sql Mobile

Mar 13, 2007

Task : connecting the central system and remote system (PocketPC) and allowing merged replication as

Following are the steps that I used to perform a replication.

1 > I am trying to Publish a Data base articled for a SQL mobile subscriber.

2 > I follow the steps in the SQL Server 2005 Mobile Edition Books Online : Creating a Mobile Application with SQL Server Mobile .

3 > At the publishing time it successfully completes all the tasks. Below is the report

Creating Publication

- Creating Publication 'SQL Mobile' (Success)

SQL Server created publication 'SQL Mobile'.

- Adding article 2 of 2 (Success)
Article 'FlightData' was added.
Article 'MembershipData' was added.

- Starting the Snapshot Agent (Success)


4 > After the publication, When I check the Snapshot Agent Status, It has stopped. (p.s. when pressed start it says starting for about few seconds and drops ) and gives an error as below
Executed as user: MAINsnapshot_agent. The replication agent encountered a failure. See the previous job step history message or Replication Monitor for more information. The step failed.

* As mentioned I checked the error log it says "encountered a non-logged user" but the user is logged on from another PC to the domain

5 > If I create a publication using SQL Server Agent service without specifying a user then it works.

View 3 Replies View Related

Replication Questions

Mar 26, 2001

I am reading up on Replication because soon I must set up merge replication at two branch offices. The reading has confused me a little....

1. Do I have to run the Distribution database on another server than the one holding the headquarters database? I tried to configure replication on this server, and I get a message that says, "SQL Server Agent on ROCK currently uses a system account, which causes replication between servers to fail. In the following dialog, specify a domain account for the service startup account."

It then presents a dialog allowing me to add an account and password. I mistakenly assumed that it would create the account if it didn't exist, but it warned me that it didn't have sufficient rights to check the account, and was I sure that it existed with all the rights required? So I cancelled, to send this message :-)

When it says "Account", I assume it means create a virtual user? What rights should I give the account? I assume it will have to be able to do anything. What database should I give it as the default? Could I have the first agent not use a system account, and thereby run the distribution server on the same machine? (I have another machine available, I just want to know if I need it, or at what point of activity I would need it.) Will it matter whether the agent on this third machine usese a system account?

2. Virtually all the tables in the database use incrementing keys. Will I have to modify this at each branch, say seeding Branch 1 to start with values of 1, Branch 2 with values of 10000, and branch 3 with values of 100000 (or other sufficiently disparate values to prevent PK collisions?

3. How frequently can I merge the databases? Can it be done at different intervals with different tables? (I.e., there are a small number of tables in which updated values would be ideally propagated as soon as possible, while most of the tables are less critical. We sell tickets, so quantity-available is pretty important, whereas someone in one office hardly cares who purchased the tickets on a sale recorded in another office. This data we can wait for, but the counts are critical.)

Advice, etc. from those experienced in implementing replication would be most appreciated.

Thanks!

View 2 Replies View Related

6.5 Replication Questions HELP ME!!!

Mar 20, 2001

We have a subscription that is failing due to '24000[Microsoft][ODBC SQL Server Driver]Invalid cursor state'

My thought was to unsubscribe and subscribe again synching the tables.
HOWEVER, I have been told that I cannot drop the table in question
and have been asked to truncate instead.
There are over 25 subscriptions to this article, so I am unable to
modify the actual article.
I started playing in the pubs database to see if I can do it before
I messed with production...

I thought if I just change the .sch script located in the repldata direcotry to truncate table instead of create table, that would be it...
However the drop table command seems to come before it even reaches
that script, cause the error I get now is 'S0002[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot truncate table 'authors', because this table does not exist in database 'pubs'.'

My question is - when and where does the "drop table" command get executed
and can I modify it without effecting the other subscriptions?

I checked the sysarticles and the column that says del_cmd is Null....

PLEASE HELP....

View 1 Replies View Related

Replication Questions???

Mar 31, 2006

Hi,

I'm having a headache with the following questions weavering around...Hope that someone can help me with the answers.

1) I've implemented a immediate updating transactional replication on 2 servers. The loopback detection is also set to true. Under normal circumstances, when there is an transaction at the subscriber, it should be replicated to the publisher. However, this was not the case here. There were some transaction in the subscriber, but they were not replicated to the publisher. Is it because of the "loopback detection" option?

2) If a bi-directional transaction is to be implemented as according to the BOL, there will be 2 distributors. When a publisher has a transaction, it will be replicated to the subscriber. When the subscriber commit the transaction, will the transaction be sent back to the publisher's distribution database? or will the distribution agent at the subscriber will know that it originated from the publisher and will not sent it to the publisher?



Pls pardon my long msg. Any advice is welcome.

View 3 Replies View Related

Replication Problem With SQL Mobile

Nov 29, 2006



Dear ppl,

I have a windows mobile 5.0 pocket PC application that performs replication between a Publihser (PC, SQL SERVER 2005), and subscriber (SQL MOBILE) on the pocket PC. The problem I am having is as follows

I created a bidirectional publication (SQL SERVER 2005). Then the pocket pc application subscribe to it (SQL Mobile). Pocket PC app add some records and then synchronise the data. Lets suppose the Pocket PC app adds 2 records on SQL Mobile in a table with primary key 2000 and 2001, which also reflected on the server after syncronisation.

Now for some reason I had to delete the publication and recreate it. My pocket PC resubscribed to the new publication, synchronise the data and get records 2000 and 2001 in SQL Mobile db. Now when the pocket Pc app tries to add a new record to it, it comes up with the error something like "duplicate values not allowed". What it is trying to do is, it is trying to add a new record with id 2000, which is already there in the table and therefore ending up throwing exception.

Can anyone please tell me what is the solution to this problem. Am i missing anything? Do i need to do something with configuring publication while recreating it after deleting it.

Regards
Nabeel Farid

View 1 Replies View Related

Replication--Too Many Questions---Too Little Solutions

Dec 15, 1998

1) Do I have to install publishing on both servers (A and B) even though one will be publisher and the other will be subscriber.

View 1 Replies View Related

Replication--Too Many Questions---Too Little Solutions

Dec 15, 1998

1) Do I have to install publishing on both servers (A and B) even
though one will be publisher and the other will be subscriber.


2)a. Can named pipes be used for communication between these two servers
which are on the same domain but not on the same network. Why or why
not, whatever the answer may be?
b. If I use TCP/IP, it the connection set up using the client
configuration utility? How is the connection string set up in this
case?
c. Suppose the publishing server was not using Net-Beui. Could this pose
any problems for communication. (is using lmhosts sufficient in this
scenario)


3) I have set up a (remote) SQL Server to be a Publisher/ Distributor.
Both SQL servers have been configured to be remote servers relative to
each other. Following are the steps I have carried out to set up
replication:

______On the Publication Server (a remote server)
I went to Server --> Replication Configuration ---> Install Publishing

Next, I chose a local distribution server. I think that the
instdis.sql script ran fine because the distribution database was
installed successfully.

___Next, I went into Manage Publications from Server menu to set up
the publications.


_____________When I went the subscription server to subscribe to the
published articles, I got the following error message:


Error 14093: [SQL Server] You must be System Administrator (SA)
or Database Owner (dbo) or Replication Subscriber (repl_subscriber)
to execute the stored procedure.




PS
Please Help

View 1 Replies View Related

MSSQL Replication Questions

Feb 16, 2007

Hello, I am playing around with the replication feature within mssql.

The system that I am developing requires a master database at a remote location, possibly at a data centre and have a onsite database. The idea of having a local database is that the system can be running in the event of no internet connection and all the local databases update the master server and the master server updating all the local databases so they all have the same data.

I have some questions.

1. I create a publication on the master server and setup a subscription on a local database; does information only go 1 way? Or do I need to setup a publication on the local database and setup a subscription on the master server for data to go both ways?

2. What is the best type of replication for information on all databases to be up-to-date with each other, Merge?

3. Is there any limitations with the replication feature that I need to be aware of?

4. Is there anything that I need to keep in mind when I set this up?

5. How much bandwidth does replication take up, I know there are a lot of factors involved when trying to calculate this type of thing but a good idea would be good.

Thank you for all your replies.

*edit* I am testing with 2 copies of mssql enterprise trial

View 2 Replies View Related

Merge Replication Questions

Oct 27, 2005

1. When intitializing a new subscriber, data that is on the publisher is not being transferred to the new subscriber. Why?

2. Data that is already on the subscriber is not being uploaded to the publisher. Why?

3. When I perform a data validation, the validation fails, but there is no option to resolve the failure (ie, transfer data one way or the other). Why?

4. For the conflict resolver: I have a rowguid and a timestamp column on each article in the publication. It was my hope that by having the timestamp, I could avoid the need to manually reconcile the conflicts between publisher and subscriber. However, I see that the conflicts are still there and still require manual intervention to eliminate. Why?

5. Where is there additional documentation on the conflict resolver (such as what values to enter in the field "Enter information needed by the resolver")?

6. What is a "Local Subscriber"? As in the statement "Use the default merge resolver and create local Subscribers." as described in the "Choosing a Resolver" topic in SQL BOL.

7. What is a "Global Subscriber"? Same reference.

Sorry for all the ignorance. Replication is relatively new to me.


Regards,

hmscott

View 1 Replies View Related

Replication Related Questions

Oct 21, 2006

I have a couple questions about replication (for both 2000 and 2005 servers):

1. which system tables/dmvs/system sprocs can I look at to determine which columns of a table are being replicated?

2. which system tables/dmvs/sprocs can I call to get metadata about publishers and subscribers?

Thanks!

View 2 Replies View Related

Client Certificates With SQL Mobile Replication

Dec 5, 2006

I am currently trying to replicate a SQL Mobile 2005 database with a SQL Server 2005 database through web synchronization using SSL Server AND Client Certificates. On IIS, with "Require Client Certificates" unchecked, I can replicate fine. Once I turn it on, I get a message from replication saying "A Secure Socket Layer connection is required to access this site". I have installed a client certificate in IE, and can access the https://servername/Ojt/sqlcesa30.dll site (I tried removing the client certificate, and I was denied access, then reinstalled it and it worked - so I think that part is working). Does anyone have any experience with this? My production operating environment requires client-side certificates.

View 5 Replies View Related

SQL Server Mobile Replication Error

Feb 7, 2006

Hello,

I've
been trying to convert an application to use the CF 2.0, and of course
to SQL Server Mobile. There have been some kinks along the road, but
I've worked all of them out except an error on replication. When I call
the SqlCeReplication's Synchronize() method, the connection goes fine,
it works for about 20-30 seconds, and then comes up with the following
error:

Error code: 0x80004005
Message: The data types cannot be converted implicitly. [ Source data type = nvarchar,Destination data type = image ]
Native error: 25932
Source: Microsoft SQL Server 2005 Mobile Edition
Error Param: nvarchar
Error Param: image

I've
tried upgrading from SQL Server 2000 to 2005 to see if that helped, but
got the same result. I even tried running this from a fresh install of
SQL Server 2005, hoping that'd integrate better with SQL Server Mobile, but that didn't help either.

I found a knowledge base article about error code 0x80004005:
http://support.microsoft.com/kb/912428
However, none of my tables are even remotely close to having 127 columns, so that can't be it.

I
do have an image data type column in one of my tables, but why is a
column being converted from nvarchar to image? Both SQL Server 2005 and
SQL Server Mobile support the image data type, so I don't
understand how that could be causing a problem in the first case.

Any ideas? I've run out of things to try and would appreciate any feedback.

Thanks,
Adrien.

View 8 Replies View Related

Must You Use 3rd Party Certs For Mobile Ssl Replication?

May 25, 2006

Hello,

We are trying to setup ssl for a merge replication mobile application. We use our own internal certificate authority to generate ssl certs, but cannot seem to get the one for our mobile merge replication to work. I see some other post about using third party vendors but is this a must? We are using .NETCF 2.0 WM 5.0. Thanks in advance.

John

View 1 Replies View Related

SQL Server Mobile Replication Performance

Dec 18, 2006

Hello,

I have been experiencing some difficulties with poorly performing synchronizations using replication from SQL Server 2005 to SQL Server Mobile running on Windows Mobile 5 devices. Currently there are two main databases (each client will only use one of them), the 1st one has around 500,000 rows, and the 2nd has about 1,200,000 rows. The initial synchronization for the 1st database takes around 45 minutes, and for the 2nd, around 2.5 hours. This is quite long, but we have comforted our clients by saying that this is a one time delay, and that further synchronizations will be much quicker. Well, synchronizing the data after this is usually quite speedy, however, things get bad rather quickly when the number of changes increases.

In normal cases, the client will have at most a few thousand changes and all is well, the synchronization will typically be under a few minutes - no big deal. Once in a while though, there are a substantial number of changes to the database (from the SQL Server 2005 side), perhaps around 50,000 changes. When this happens, the synchronization process doesn't seem to ever finish (I've left it over the weekend and come back to find it still synchronizing). For the record, there seems to be a level at which the database will finish synchronizing, but be agonizingly slow - around 10,000 to 20,000 records will finish eventually (but take a few hours, at which point it's faster to just blow away the database and start again from scratch). This is obviously not acceptable, and I need to find a way to resolve this. Does anyone have any thoughts?

While on this topic, why does this synchronization process take so long anyways? The snapshot creation (even for the database with millions of rows) finishes in a couple minutes, and the actual transfer of data shouldn't take more than a few minutes. The device can't possibly be storing the database content in memory (the SDF file ends up being between 40MB and 100MB), but when I watch network activity, there tends to be an initial busy period, then a periodic and fairly small spike every few seconds until the process completes, so the connection isn't being saturated at all.

At this point, I am almost considering breaking the nice database design I have and creating combined logical records to see if reducing the number of rows may help. I'd really prefer not to have to go this route though, so if anyone has any suggestions, I'd really appreciate some feedback.

Thanks,
Adrien.

View 6 Replies View Related

Merge Replication With SQL Mobile 2005

Apr 25, 2006

We are using SQL 2005 (SP1) and mobile agents with SQL Mobile. We are seeing an excessive number of updates after a device's database is reinitialized. My understanding was that if I generate a new snapshot or reinitialize all subscriptions (from the server), the devices would only get what the database looks like right now (inserts only) after syncing and/or reinitializing, but they are actually getting the right number of inserts and a huge number of updates in Replication Monitor. Any ideas?



Thanks!

Mike

View 23 Replies View Related

Using Row Filtering In SQL Mobile Merge Replication

Oct 25, 2007

Hi,,

I understand that it is possible to set filters dynamically using functions 1) SUSER_SNAME() 2) and HOST_NAME().
SUSER_SNAME() returns the login credentials used in the subscritption.
HOST_NAME() returns the host machine and can be overloaded with buisiness information.

My application should work as below;
1) User enters the login credentials.
2) Some information as the User name passed to server and if the user name is valid , the rows related to this particular user get downloaded to device.

A new user is added directly in the Users table in master database.

My questions are :
1) If I have 3000 users , should I create 3000 subscriptions with 3000 HOSTName or Login credential information to differentiate btween users?
2) If yes , other than using the wizard is there any scripts available to create large number of subscription?
3) If add subscription programatically , should I re-initialise subscription for each new user which is assigned with a diferrent host name value?

my current code looks like this

SqlCeReplication repl = new SqlCeReplication();

repl.InternetUrl = @"http://100.000.000.000/test/sqlcesa30.dll";
repl.Publisher = @"something";
repl.PublisherDatabase = @"something";
repl.PublisherSecurityMode = SecurityType.DBAuthentication;
repl.PublisherLogin = @"sa";
repl.PublisherPassword = @"something";
repl.Publication = @"somethingPublisher";
repl.Subscriber = @"something";

repl.HostName = @"newuser"; // The user name entered in the login form assigned to Hostname property.

repl.SubscriberConnectionString = @"Data Source=""Program Files esthost.sdf"";Max Database Size=128;Default Lock Escalation =100;";

try
{

repl.ReinitializeSubscription(true);
repl.Synchronize();
repl.Dispose();

}

Please advise

-Aneesh

View 4 Replies View Related

Merge Replication Using Wins Mobile 5.0

May 3, 2006

Hi all,

I have developed a mobile program with sql server 2000 merge replication. It works fine in Win mobile 2003 OS, but, not working at all after I upgrade the mobile OS to Win mobile version 5.0

Does anyone have any idea at all what's going on?

Thanks a lot.

AngelaC









View 4 Replies View Related

SQL Server - Transactional Replication Questions

Sep 5, 2005

Our database has grown to the point where our current server is struggeling with the query load. One option is to get a 4 processor machine with 16GB of RAM, but I'm also looking at transactional replication as a solution. Currently we run dual Xeon with 4GB of ram (using the /3GB switch in the OS) We have SQL 2000 Enterprise.
The idea is to setup a secondary server with transactional replication pushed from the main server, so that some SELECT-only queries can be executed on the secondary server - thus taking load of the main one. We should be able to add PKs to the small number of tables that currently don't have them, and we should be able to run all updates / inserts on the main server.I'll setup a push-subscription for the entire DB (maybe excluding some log tables) and then for ceratain stored procedures I'll direct our applications to use the backup instead of the main server.
So: Is this a good idea? Is it easy to backup the server using transactional replication? How much extra overhead will this mean for the main server?

View 1 Replies View Related

Merge Replication Problem On Windows Mobile 5

Sep 9, 2006

Hi,

I developed a mobile application (CF 2.0) that uses merge replication to synchronize data between SQL Server Mobile and SQL Server 2000 SP4. The application uses asynchronous synchronization (BeginSynchronize method) to initiate the replication and update the user about the progress. The application worked perfectly on PPC2003 and Windows CE .Net 4.2 platformes.

The problem started when I moved it to WM5 platform. We're using Symbol MC70 devices.

When I start the replication for the first time it synchronizes without a problem. If I perform additional synchronizations(updates) it synchronizes without a problem. If I exit the application and start it again the sync process hangs when I try to synchronize it(to deliver updates).

Any ideas?

Thank you

View 3 Replies View Related

Locking Up After SQL Server Mobile Merge Replication

Nov 17, 2005

Hi,

View 14 Replies View Related

Merge Replication Using SSL On A Windows Mobile 5.0 Device

Feb 5, 2007



Dear ppl,

I have a windows mobile 5.0 application that syncronises with SQL Sever 2005 (Merge Replication). The replication works fine without SSL. But when using SSL it doesn't work .On the device i get an error





28037, A request to send data to the computer running IIS has failed.

I have created a a Wild Card Certificate (*.domain-name.net) using Microsoft Certificate Services (Stand Alone) and setup the replication website with replication virtual directory under it , in IIS, to use this certificate. The host header for the replication site is set to "sql.domain-name.net". I have binded the host headers to the port as well.

I can access the https://sql.domain-name.net/replication/sqlcesa30.dll from remote computer and device and it says Microsoft SQL Server Compact Edition Server Agent, that means it is setup correctly.

I have installed the certificate authority and its wild card certificate on the device Root Certificates. Now when I call repl.syncrhonise() from device .. it throws exception with error 28037, A request to send data to the computer running IIS has failed.

which i think means, it can't find the service url.

I am not sure what is the problem..something to do with Trust - SSL certificates... Is there any thing i am missing ?

Awaiting,



View 9 Replies View Related

Locking Up After SQL Server Mobile Merge Replication

Nov 9, 2007



Hi ,
I would like to get your advice in an issue that I am facing regarding merge replication.
The flow is like:
1) User enter his login name and password.
2) Host_name is set as the login name that the user enters.
3) Based on the HOST_NAME property after filtering user gets the records relevent only to him
(Differnet subscriber may use same mobile device).

4) He make some changes in the local sdf according to the business logic.
5) The application Syncs with server on the next login session.

My issue is when I am trying to run the application in emulator exactly at the sdf updating part the application terminates.
Error mess: Connection to Remote Device has been lost.....
If I execute the same sql insert query it works om the local sdf and master database.
Emulator used where Pocket PC 2003 SE and Windows Mobile 6 classic emulator.
I have installed 1) Visual Studio 2005 SP 1 2) net compact framework SP2.

When I comment all the code related to Sync ,application works witout any issue.
And the same application works in my "I mate kjam".

The code that I use is given below:
==========================================================================

public void Sync(string hostname, int newsub) // Parameters for HOSTNAME and flag to denote new user or existing //user.

{

SqlCeReplication repl = new SqlCeReplication();

repl.InternetUrl = @"http://231.000.000.211/Merge/sqlcesa30.dll";

repl.Publisher = @"SERVER";

repl.PublisherDatabase = @"Merge";

repl.PublisherSecurityMode = SecurityType.DBAuthentication;

repl.PublisherLogin = @"sa";

repl.PublisherPassword = @"password";

repl.Publication = @"Merge";

repl.Subscriber = @"MergeSub";

repl.HostName = hostname;







repl.SubscriberConnectionString = @"Data Source=""Program FilesMerge.sdf"";Max Database Size=128;Default Lock Escalation =100;";





try

{

if (newsub == 0)

{

if (File.Exists(@"Program FilesMerge.sdf"))

{

File.Delete(@"Program FilesMerge.sdf");

}



repl.AddSubscription(AddOption.CreateDatabase);

repl.Synchronize();

repl.Dispose();

MessageBox.Show("newuser sync Done");

}

else

{

if (!File.Exists(@"Program FilesMerge.sdf"))

{

repl.AddSubscription(AddOption.CreateDatabase);

repl.Synchronize();

repl.Dispose();

MessageBox.Show("FirstSync Done");

}

else

{

repl.Synchronize();

repl.Dispose();

MessageBox.Show("SameuserSync Done");

}

}

=================================================================================
Please advise......

View 1 Replies View Related

Merge Replication Between SQL Server 2005 And SQL Mobile

Oct 18, 2007

Hi,

I'm currently investigating the feasibility of having SQL Mobile on a number of devices running Windows CE. These devices will have to synchronize with the server (either using merge replication or RDA) over GPRS. The problem I have is that some of these devices will never be online. Is there are a way of synching these offline devices? The model I had in mind was using a USB key (or some other storage device) to download the latest updates from an online device and transferring this data to the offline device, and vice versa e.g. from offline to online and then merging. Is this feasible?

Thanks

Csharper

View 2 Replies View Related

Database Mirror + Snapshot + Replication Questions

Aug 28, 2007

All,

We have SQL 2005 db mirror configured with a witness server for high availability. Node 1 is the principal and Node 2 is the mirror. A nightly job creates a snapshot on Node 2. The snapshot is used for previous day reporting queries. We have now been asked to present another copy of the database for near-time reporting. I thought about possibly adding a peer-to-peer replication as part of my environment but was hoping to see what everyone else out there is doing.

Regards,

Ian

View 1 Replies View Related

Merge Replication Questions [SQL2k5 Non Express]

Jun 1, 2006

I can choose synchronization direction for articles: a) Bidirectional b) one way

1) Is that possible somehow to replicate the schema only of an article but no synchronization / zero direction :-)/

2) Same question about columns, I should replicate schema only for few columns, but without data synch. These columns are freely updateable at anywhere (publisher and subscribers), but the data changes shouldn't be replicated.

Thanks for the answers in advance

View 6 Replies View Related

SQL Mobile Fails To Send Data To IIS - Merge Replication

Nov 22, 2006

This is just too simple. I must be doing something wrong. I have tried everything, redoing the SQLMobile merge publication, setting permissions, and need help ASAP.

The basic test with the http://localhost/sqlmobile/sqlcesa30.dll returns the message:

SQL Server Mobile Server Agent 3.0

I have tried the merge replication with both my local SQL Server 2005 installation and a remote development box. Both instances return the same error.

I am able create and replicate a database using the sample application:

http://msdn2.microsoft.com/en-us/library/ms171908.aspx

However, another simple applications fails to synchronize when simply using the following code block:

Dim repl As New SqlCeReplication()
repl.InternetUrl = "http://xens/sqlmobile/sqlcesa30.dll"
repl.Publisher = "xena"
repl.PublisherDatabase = "SQLMobile"
repl.PublisherSecurityMode = SecurityType.NTAuthentication
repl.Publication = "SQLMobile"
repl.Subscriber = "sqlmobile"
repl.SubscriberConnectionString = _
"Data Source='" + filename + "';Password='';" _
& "Max Database Size='128';Default Lock Escalation ='100';"

repl.AddSubscription(AddOption.CreateDatabase)
repl.Synchronize()


Here is the error message:

Error Code: 80072EE7

Message: A request to send data to the computer running IIS has failed. For more information, see HRESULT.

Minor Err. 28037

Source Microsoft SQL Server 2005 Mobile Edition

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

Here is the full code sample:

Imports System.Data.SqlServerCe

Imports System.Text



Public Class Form1

Private engine As SqlCeEngine

Private repl As New SqlCeReplication()

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

engine = New SqlCeEngine()

engine.LocalConnectionString = "Data Source=""sqlmobile.sdf"";Max Database Size=128;Default Lock Escalation =100;"

engine.CreateDatabase() <- First method creates database

engine.Dispose()

engine = Nothing



repl.InternetUrl = "http://xena/sqlmobile/sqlcesa30.dll"

repl.Publisher = "xenaSQL2005"

repl.PublisherDatabase = "SQLMobile"

repl.PublisherSecurityMode = SecurityType.NTAuthentication

repl.Publication = "SQLMobile"

repl.Subscriber = "SQLMobile"

repl.SubscriberConnectionString = "Data Source=""sqlmobile.sdf"";Max Database Size=128;Default Lock Escalation =100;"

Try

'repl.AddSubscription(AddOption.CreateDatabase) <- this method fails also

repl.AddSubscription(AddOption.ExistingDatabase)

repl.Synchronize() <-- Code fails here with the error message shown.

Catch err As SqlCeException

ShowErrors(err)

'MessageBox.Show(err.ToString)

End Try

End Sub

Public Sub ShowErrors(ByVal e As SqlCeException)

Dim errorCollection As SqlCeErrorCollection = e.Errors

Dim bld As New StringBuilder

Dim inner As Exception = e.InnerException

Dim err As SqlCeError

If Not inner Is Nothing Then

MessageBox.Show(("Inner exception: " & inner.ToString()))

End If

' Enumerate each error to a message box.

For Each err In errorCollection

bld.Append((ControlChars.Cr & " Error Code: " & err.HResult.ToString("X")))

bld.Append((ControlChars.Cr & " Message : " & err.Message))

bld.Append((ControlChars.Cr & " Minor Err.: " & err.NativeError))

bld.Append((ControlChars.Cr & " Source : " & err.Source))

' Retrieve the error parameter numbers for each error.

Dim numPar As Integer

For Each numPar In err.NumericErrorParameters

If 0 <> numPar Then

bld.Append((ControlChars.Cr & " Num. Par. : " & numPar))

End If

Next numPar

' Retrieve the error parameters for each error.

Dim errPar As String

For Each errPar In err.ErrorParameters

If [String].Empty <> errPar Then

bld.Append((ControlChars.Cr & " Err. Par. : " & errPar))

End If

Next errPar

MessageBox.Show(bld.ToString())

bld.Remove(0, bld.Length)

Next err

End Sub

End Class

Thanks in advance....



View 4 Replies View Related

SQL 2005 Mobile Merge Replication Size Limits?

Feb 8, 2006

I am in the process of testing a SQL 2005 Std x64 server with merge replication using Windows Mobile 5.0 clients and SQL 2005 Mobile. The test DB is a copy of the currently active DB, but has been expanded to include some new tables to support planned application functionality extensions.

Once the publication exceeds 97 Articles, the error is thrown that "The buffer pool is too small or there are too many open cursors". If I drop one article everything is fine. I ran a test with dummy DB that had 100 blank tables, and this initialized just fine on the client. The additional articles I am publishing (the 98th table) is also empty, but it throws the error anyway.

Is there a limit on the total size/number of changes that can be sent? Since I have run tests sending over 64,000 changes to a client during initialization this does not seem to be the case (I am only attempting a little more than 9,700 changes on this initialization).

Some other ideas that have been tested without success are to stop the user triggers from propagating, and toggling the AWE setting for SQL. The Replication Monitor does say the client completes replication, and it seems to choke at the very end of completing replication when it attempts to write to the tracking tables. The last successful action is sys.sp_MSadd_merge_history90, and it appears to be acting on the last table added to the publication.

There does not appear to be a limit on the number or articles, since I can publish more articles in a dummy DB than I am able here, so it seems to be something to do with size. Any information would be helpful, this is a very frustrating issue. Thanks!

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved