Author |
Share Topic Topic Search Topic Options
|
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Topic: Remote Persistence Posted: 24-Jul-2009 at 2:40pm |
Hi,
We have just recently upgraded to the latest 3.6.7.1 release. No matter what settings I use it seems to still think I'm using remote persistence. I have even overidden the PersistenceManager create to ONLY use Local not even Default service and NO MATTER WHAT it still thinks it should be connecting to a BOS!
username="Mark-Laptop\Mark" source="IdeaBlade.Persistence.DataSourceResolver:.ctor">Probed for 'IDataSourceKeyResolver' and found Spindlemedia.Utils.LoginManager.LoginManagerDataSourceKeyResolver</entry> username="Mark-Laptop\Mark" source="IdeaBlade.Persistence.PersistenceManager:.ctor">Loaded IdeaBlade.Persistence.RemotingPersistenceServerProxy</entry> username="Mark-Laptop\Mark" source="IdeaBlade.Persistence.RemotingPersistenceService:get_LocalInstance">PersistenceService created</entry> username="Mark-Laptop\Mark" source="IdeaBlade.Persistence.RemotingPersistenceServerProxy:GetPersistenceServer">Created local PersistenceService</entry> username="Mark-Laptop\Mark" source="System.RuntimeMethodHandle:_InvokeConstructor">PersistenceServer created for DataSourceExtension: [None]</entry> username="Mark-Laptop\Mark" source="IdeaBlade.Persistence.DataSourceResolver:.ctor">Probed for 'IDataSourceKeyResolver' and found Spindlemedia.Utils.LoginManager.LoginManagerDataSourceKeyResolver</entry> username="Mark-Laptop\Mark" source="IdeaBlade.Persistence.Server.SessionManager:GetPersistenceLoginManager">Probed for 'IPersistenceLoginManager' and found Spindlemedia.Utils.LoginManager.LoginManager</entry> username="Mark-Laptop\Mark" source="IdeaBlade.UI.WinForms.DotnetControls.DataGridViewBinderMap:.ctor">Loading UI binders from IdeaBlade.UI.WinForms.DotnetControls</entry> username="sa" source="IdeaBlade.Persistence.RemotingPersistenceService:get_RemoteInstance">Trying automatic remoting configuration using Spindlemedia.SMIGL.UI.EXE.config</entry> username="sa" source="IdeaBlade.Persistence.RemotingPersistenceService:GetRemoteInstance">PersistenceService not found in config file.</entry> username="sa" source="IdeaBlade.Persistence.RemotingPersistenceService:get_RemoteInstance">Trying programmatic remoting configuration using IdeaBlade.ibconfig</entry>
As you can see it starts off using a LocalInstance through my credentials, and then it appears to have logged in but then that happens!! This is all off of a .Login() call.
I had upgraded a couple weeks ago and had the same problem. Downgrading to 3.6.6.1 FIXES the problem so something has to have changed. Any suggestions?
Thanks!
Mark
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 24-Jul-2009 at 7:15pm |
There weren't really all that many changes between versions 3.6.6 and 3.6.7 and none should have had anything to do with the remoting layer. Are you using a custom ILoginCredential with your LoginManager? The ILoginCredential now serializes differently, but that wouldn't seem to cause the issue you're seeing.
Are all the log messages for username="sa" generated AFTER the pm.Login call completes, or are they coming from within your LoginManager code?
There really shouldn't be anything that would cause the remoting code to be spontaneously entered. Here are a couple of things to look for -
- Are you using the RemotingPersistenceService anywhere within your code - accessing the RemoteInstance property or calling Reconnect()?
- Do you modify the in-memory IdeaBladeConfig at any time?
- Are you using reflection to access the RemotingPersistenceServerProxy to call Reconnect?
|
 |
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 24-Jul-2009 at 9:04pm |
Hi Kim,
Thank's for the reply I am using a custom credential yes, but as the login is all done client side (The login manager just builds the connection string based on users choice of windows/sql authentication). I'm simply calling login with the credential, and that doesn't return - it throw's that exception saying it cant connect to "//:443" (I don't have a host specified in the config file and remotepersistence is set to false). RIGHT before the login call I did an assert of the RemotePersitenceEnabled and the PersistenceServiceOption which are set to false/local respectively.
It's very strange!!
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 25-Jul-2009 at 4:40pm |
Very curious.
For one, it's odd to see the UI binders message right in the middle of all of this. Is this application multi-threaded?
For another, DevForce doesn't set the Thread.CurrentPrincipal until after the Login completes, yet we see the new principal ("sa") here in the final trace messages apparently occuring during login.
|
 |
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 25-Jul-2009 at 5:09pm |
Could it be because our login manger is explicitly setting the Thread.CurrentPrincipal? All it is doing is setting the principal and returning a 'UserPrincipal' object (Which is just a basic implementation of IPrincipal) with the credentials contained inside.
If you think that could be the issue I could upgrade back to 3.7 again and try.
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 25-Jul-2009 at 5:15pm |
Setting the CurrentPrincipal shouldn't be an issue, but helps explain why the new username is showing in the log.
How about your ILoginCredential - do you by any chance have a PersistenceManager field or property defined in it?
I'd still really like to see your LoginManager ...
|
 |
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 27-Jul-2009 at 1:58pm |
Hi Kim,
Sent to that email with "3.7 LoginManager Issue" as subject
Thanks!
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 28-Jul-2009 at 10:14am |
Thanks, that cleared things up.
The problem is due to changes in how the ILoginCredential serializes. If you mark your custom LoginManagerCredential class as Serializable this will fix the problem.
In 3.6.7, to fix other problems, we now serialize the ILoginCredential when storing it in the SessionBundle, so the ILoginCredential implementation must now be serializable. The standard LoginCredential is decorated with the Serializable attribute, and we should be documenting somewhere - although a quick check isn't finding where - that this is always required for a credential, not just when using a BOS.
(The reason you see a remote connection attempt is because error handling for serialization exceptions thrown during certain calls, like Login, assumes that this occurred while communicating with the BOS, so reconnect logic is tried.)
|
 |
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-Jul-2009 at 11:59am |
Perfect! I will try it out soon and let you know.
Thanks for the help Kim!
|
 |
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-Jul-2009 at 12:58pm |
Works! Thanks :)
|
 |