You can remove the jdbc2Info key from the connection dictionary(ies) and then 
call setConnectionDictionary on the adaptor for each model (or just one if they 
all connect to the same database).  Then call 
JDBCAdaptor.typeInfoModel(EOModel) get get things setup again.  That looks like 
it should do it.

Chuck


From: 
<webobjects-dev-bounces+chill=gevityinc....@lists.apple.com<mailto:webobjects-dev-bounces+chill=gevityinc....@lists.apple.com>>
 on behalf of Paul Hoadley <pa...@logicsquad.net<mailto:pa...@logicsquad.net>>
Date: Thursday, March 3, 2016 at 3:13 PM
To: WebObjects Development 
<webobjects-dev@lists.apple.com<mailto:webobjects-dev@lists.apple.com>>
Subject: Can I force a reload of a database's JDBC info?

Hello,

As discussed in a recent thread (“Use case for a "case insensitive equals" 
qualifier”), I want to use PostgreSQL’s CITEXT extension type on a column 
(User.username). I’d like to make the change using migrations.

Because CITEXT is an extension type, you need to create it in any database 
where you want to use it:

CREATE EXTENSION IF NOT EXISTS citext;

That’s fine: I can just call ERXJDBCUtilities.executeUpdate() in the 
appropriate migration upgrade(). However, what _seems_ to be going on is that 
EOF loads the database’s JDBC info at launch, and (because the extension hasn’t 
been created) it doesn’t seem to contain CITEXT. So, despite running CREATE 
EXTENSION in the migration, it fails because nothing is known about the 
External Type for that attribute:

JDBCAdaptorException: Unable to find type information for external type 
'citext' in attribute 'username' of entity 'User'.  Check spelling and 
capitalization.

If I create the extension manually before launching and running that migration, 
it proceeds just fine.

Am I stuck with manually creating the extension everywhere I want to deploy 
this, or is there a way to force EOF to reload the JDBC info at the appropriate 
time?


--
Paul Hoadley
http://logicsquad.net/



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to