[Seaside] Re: GLORP

Jeremy Shute shutej at crazilocks.com
Mon Jun 26 12:37:20 UTC 2006

> Jeremy Shute wrote:
>> Yes, I explicitly forced a recompile, because I loaded Cryptography
>> after
>> PostgresV2.  Unfortunately, when switching back to "md5" encryption, it
>> still fails with the same error.  Hmmm...
>> Also, with an open transcript, I notice that GLORP has a bug, where in:
> If the unit tests for postgres work when you enable "md5",
> then the postgres connection is working.
> Can you give a recap of what problems you're having?


I mentioned a problem with the state machine previously, when the database
is set up in "md5" mode.  This error occurred both before and after
downloading Cryptography and recompiling PostgresV2 and trying to connect
in "md5" mode.  Therefore, everything I say from this point forward is
qualified by the fact that connections are made in "plaintext" mode...


	| session admin |
	session := self newSession.

	"First, we would like to drop all the database tables.  This destroys the
	session accessor dropTables: ((TableSorter for: (session system)
allTables) sort reversed).

	"Now, we would like to recreate all the tables."
	session inTransactionDo: [
		session system allTables do: [:each |
			session accessor createTable: each ifError: [:error |
				Transcript show: error messageText

	"Now, we would like to ensure that at least one login exists."
	admin := TestLogin new.
		login: 'my_admin_name';
		password: 'my_admin_password'.
	session beginUnitOfWork.
	session register: admin.
	session commitUnitOfWork

Sending this message appears to succeed from the Workspace, except that it
prints the following in the transcript:

ERROR:  constraint "login_uniq" does not exist
[PGConnection(1277)] NOTIFICATION: PGNoticeResponse(value='NOTICE:  CREATE
TABLE / PRIMARY KEY will create implicit index "login_pk" for table

...which is highlighting the fact that Postgres is implicitly making
"login_pk" and GLORP is attempting to explicitly delete it later as
"login_uniq".  Changing the '_UNIQ' to '_PK' in the GLORP code still does
not allow the drop.  Is this expected, and something the season
professional ignores???


The above routine, despite appearing to succeed, is not inserting the row
with 'my_admin_name' and 'my_admin_password'.  This, I am still
diagnosing, because the GLORP SUnit tests share the connection string and
write to the database just fine.


More information about the Seaside mailing list