[Seaside] Re: GLORP

Yanni Chiu yanni at rogers.com
Fri Jun 23 04:05:52 UTC 2006


Jeremy Shute wrote:
> When I do that, edit the Postgres configuration, and edit the PGConnection
> class>>buildDefaultConnectionArgs to refer to my new configuration ...

That's the right thing to do. Just as a sanity check,
make sure psql can connect to your server. That's not likely
a problem for a local server, but a remote server may need
some configuration to allow remote connections.

> "Error: PGConnection has a defective state machine."

What this means is that the underlying state machine has not
correctly accounted for all possible scenarios. In this case,
it's probably an error condition that's left things in a
bad state. I see this error message sometimes when I save an
image with an open database connection, and then restart the
image. After I have proper code to reconnect to the database
on image restart, I rarely see the message anymore.

> It is trying to find eventName #AuthenticationMD5Password in the
> stateTransitionTable.  Except the instance variable "state" it is using is
> already set to #CantHappen...

You need to load the Cryptography package off SqueakMap,
if you want to use MD5 authentication. Otherwise, you can
only use PlainText authentication.

 > I'm having a very difficult time tracking
> the logic, to be honest.

It's a state machine design. Each message received from
the postgres server is treated as an event to the PGConnection
state machine. The event causes a state transition. Upon entering
the new state, the method named like "st<StateName>" is executed.

The state machine is pictured here:
     http://ca.geocities.com/zazu@rogers.com/pgsqueak/PGConnection.5.gif
That diagram is slightly out of date, if you look in the method:
     PGConnection>>buildStateTransitionTable
you'll see a representation of the real version used by the code.



More information about the Seaside mailing list