Bug in Glorp Login >> #= ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug in Glorp Login >> #= ?

Mariano Martinez Peck
Wow...after a couple of hours chasing a problem in my app, I faced a problem with Glorp's Login. I was using a ConnectionPool that uses a Dictionary to store Login. Each kay is a login instance and the value is an instance of a connection pool. 

But I was getting multiple instances (entries in the dictionary and pool instances). The problem is Login >>#= 

= aLogin 
self halt.
^self class == aLogin class and: 
[self name = aLogin name and: 
[self database class = aLogin database class and: 
[self username = aLogin username and: 
[self password = aLogin password 
and: [self connectString = aLogin connectString]]]]]

Because it expects the passwords to be equal, while Login can be "secure" and hence, the password is nil after the login. So what happened here is that my Login were secure (by default you have that behavior) and hence, two Login that were created exactly with the same data will give you false once on of them is logged. 

Solutions?

1) Ignore the password check when using secure connections?

Workarounds?

a) In my app I can try to store somewhere the Login instance and always reuse it. 
But I am not sure if this could work...because I will have multiple PharoDatabaseAccessors pointing to the same Login instance...

b) send a secure: false  to my Login instances.... 

Of course I would try to avoid having to do b).

Any ideas?



--
Mariano
http://marianopeck.wordpress.com

--
You received this message because you are subscribed to the Google Groups "DBXTalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.