SQL Server Everywhere Merge Replication problem - you're not going to believe this

You Can Take it With You

Syndication

News

I've been digging around SQL Server Everywhere (SQLEv) quite a bit lately. It's been great to have the simplicity and portability of SQL Mobile on the desktop. Most of my SQL Mobile code that I've ported to SQLEv has done so with little or no code changes.
 
Most that is….
 
While porting some working SQL Mobile Merge Replication code over to SQLEv, I started getting a rather unhelpful error message "Internal Error: Invalid reconciler parameter".
 
After a great deal of pain (and a few emails to the right people),  I found out that the cause of the problem has existed for many years - It's just that the scenario that creates the error is much more likely on a Windows desktop then on a Windows Mobile device.
 
Remember - SQLEv uses the same server tools to perform Merge Replication as SQL Mobile does.
 
While doing a synchronize with the server, the client (SQLEv or SQL Mobile app) sends several parameters to the SQL Mobile/SQLEv server agent. The server agent has a series of 128 character buffers to store the parameters.
 
(Here's the big finale) One of the parameters sent to the server agent is the fully qualified pathname of the local database file. In Windows Mobile one is reasonably unlikely to have a local pathname greater the 128 characters.
 
In a desktop application, it's very easy to have a local pathname greater then 128 characters. In fact in many cases creating a SQLEv project in the default VS project folder (C:\Documents and Settings\Jim Wilson\My Documents\Visual Studio 2005\Projects) will cause the error. Yet if you move the project folder directly under the C-drive root, things work just fine (shorter filename).
 
I haven't heard what the long-term solution to the problem will be but it seems to me two things have to happen.
  • The server tools must support the standard MAX_PATH length of 260 characters
  • When a file name is too long (or any other parameter that violates the requirements) - give us an error messages that actually tells us what happened not "Internal Error: Invalid reconciler parameter".
 
So the moral of the story: Be sure to create all of your SQLEv projects close enough to the drive root that the fully qualified pathname of your db file at runtime will fit in the server agent's 128 character buffer. The same goes for deployment if you happen to be deploying programs using the SQLEv CTP.
 

Posted Jun 18 2006, 07:51 PM by jim-wilson

Comments

Rob Gillen wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-05-2007 7:18 AM
Does this problem still exist? if so, how do they intend for you to use it with click-once deployments (for which the path to the data directory is auto-calculated and long)
Jim Wilson wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-05-2007 7:29 AM
Rob;

Great question - yes the problem is fixed now. The latest beta/RC's have it fixed and it is of course fixed in the RTM. :-)

Regarding ClickOnce...

I know that works well. My company is the one that wrote the SQL Server Compact Edition tutorials.

You can check out the SQL Server Compact Edition ClickOnce tutorials at the following URLs:

C#: http://msdn2.microsoft.com/en-us/library/bb219481.aspx

VB.NET: http://msdn2.microsoft.com/en-us/library/bb219482.aspx

Hope this helps,
-Jim
Rob Gillen wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-05-2007 8:40 AM
Actually, I'm having no trouble interating with the db deployed via ClickOnce, however as soon as I attempt a merge replication operation I get the error indicated above. I'm using the RC1 version of SQLCompact... There are others who seem to be hitting the same problem (http://community.softteq.com/blogs/nick/archive/2006/11/29/8354.aspx and http://community.softteq.com/blogs/nick/archive/2006/11/29/8357.aspx). Have you had success with RC1?
Jim Wilson wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-05-2007 8:53 AM
Rob;

Have you uninstalled the SQL Mobile Server Tools and installed the SQL Server Everywhere/CE Server tools.

Installing SQL Server Everywhere/CE overwrites the SQL Mobile Server Tools install file on your machine with the SQL Server Everywhere/CE Server Tools install file but you do have to do the actual install yourself.

The thing to do is to use Add/Remove programs to remove Microsoft SQL Server 2005 Mobile Server Tools. Then run [Program Files]\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\Sqlce30setupen.msi

-Jim
Rob Vettor wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-05-2007 9:12 AM
Jim...

Thanks for saving me hours of agony!

You are on the money! Moved the .sdf file up to a subdirectory off of the root c:\ and works likes a champ.

Agree that Msoft needs to correct this issue and generate an error message that has meaning.

Rob Vettor
Jim Wilson wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-05-2007 9:23 AM
Rob;

Glad I can help - Me and one of the guys that works with me spent almost 2 days trying to figure out this issue the first time we hit it. A real error message would've helped sooooo much. :-)

Does installing the SQL Server Everywhere/CE Server Tools allow you to put the database where you'd like?

I'm pretty sure that the RC1 SQL Server Everywhere/CE Server Tools have the corrected path length size of MAX_PATH.

-Jim
Rob Gillen wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-05-2007 11:09 AM
Still no dice... here's what I did....

On the SQL server (which is also my HTTP endpoint) I went to add/remove programs and removed the Microsoft SQL Server 2005 Mobile Server Tools. I then installed SQLCompact Edition (sqlserverev31-EN.msi) that I obtained from (http://www.microsoft.com/downloads/details.aspx?FamilyId=85E0C3CE-3FA1-453A-8CE9-AF6CA20946C3&displaylang=en). I then installed the server tools sqlce30setupen.msi from (http://www.microsoft.com/downloads/details.aspx?FamilyId=6ED0FB7E-7C05-4F59-879A-8FB619E36612&displaylang=en) - it wasn't on my local machine in the path you indicated.

I then went into SSMS and configured a new vdir for SQL 2005 mobile replication.

On a different machine, I rebuilt/deployed my ClickOnce app (configured for the new vdir) and received teh same failure message... running the app from a dir with < 128 chars works like a champ...

Is the problem on the client side or on the server side? Do i need to update files within the click once app?
Jim Wilson wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-05-2007 11:33 AM
The problem is definitly server side. That's where the 128 limit is. I've done experiments in the past where I had a situation that broke, fixed only the server, and things then work fine.

I'm gonna follow up w/ the SQL CE dev team to see what the story is regarding the public versions. I'll email them today.

I'm actually flying out to Redmond on Sunday and have a meeting planned with the SQL CE Dev lead on Tuesday. If I don't have an answer back via email by then, I'll talk to him specifically about the issue.

-Jim
Rob Gillen wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-10-2007 4:30 AM
Any chance you've learned anything further on this?

Thanks
Rob Gillen wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-11-2007 4:43 AM
Just to close the loop on this... I've deployed the just-released-today RTM bits and this problem has gone away... thanks for the help/explanation of what was occuring.
Jim Wilson wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 01-11-2007 7:22 AM
Rob;

I'm glad that the RTM came out quickly enough to resolve things for you.

Sorry I didn't get back to you before today. I was in meetings all day Monday & Tuesday (and dinner meetings in the evening). I flew home on a red-eye (I live in NH) Tuesday night only to arrive in my office Wednesday morning into a number of technical "emergencies" :-) Today is the first time this week I've had a chance to get onto the blog.

-Jim
Rob Gillen's WebLog wrote SQL Server 2005 Compact Edition - Kudos to the SQL Team
on 01-24-2007 12:30 PM
If you track the Microsoft or ASP.NET weblogs you&#39;ve surely noticed that roughly two weeks ago now
Helen N wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 09-19-2007 7:53 AM
Hi,
I have the same problem but I did not succeed to resolve it. When I deploy the application, it is not possible for me to move the folders at the root.
Rob Gillen said "I've deployed the just-released-today RTM bits and this problem has gone away". Could you precise what is "just-released-today RTM bits", so that I could try to fix the problem.

Thanks
Jim Wilson wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 09-19-2007 8:27 AM
Helen;

The 128 character limit is fixed in the more up-to-date server tools releases.

If you download and install the server tools version from this location, things should start working:
http://www.microsoft.com/downloads/details.aspx?FamilyId=4E45F676-E69A-4F7F-A016-C1585ACF4310&displaylang=en

Hope that helps,
jim
pk wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 11-12-2007 1:22 PM
I have the same problem and I am using compact 3.5 and even the latest 3.1.

I am including the latest dll's as per the tutorial link referenced above, but can't get past this error if the path is too long.

The other catch is that I have to store the database on a per user level in user app data path.

Any suggestions would be helpfull.
Jim Wilson wrote re: SQL Server Everywhere Merge Replication problem - you're not going to believe this
on 11-12-2007 3:13 PM
pk;

The problem is created by the server install. Unfortunately, upgrading the local version of SSCE doesn't help.

The thing to do is to make sure that the latest version of SQL Server Compact Edition Server Tools is installed on both the servers running IIS and SQL Server.

Hope that helps.

-Jim

Add a Comment

(required)  
(optional)
(required)  
Remember Me?