Re: The conection dictionary at "start-up"
Re: The conection dictionary at "start-up"
- Subject: Re: The conection dictionary at "start-up"
- From: Ricardo Strausz <email@hidden>
- Date: Mon, 13 Oct 2003 20:02:54 -0600
Hola otraves y gracias Art!
On lunes, octu 13, 2003, at 15:00 America/Mexico_City, Art Isbell wrote:
> On Monday, October 13, 2003, at 05:59 AM, email@hidden
> wrote:
>
>> Keep in mind that normally, in WO, there is a single EOF stack (often
>> meaning a single db connection) shared by multiple users (WOSessions).
>> Under this design, it's rather dificult to have a user log in to the
>> db---multiple users share the connection dictionary. Unless you are
>> just
>> talking about an admin setting the connection dictionary once on
>> startup
>> or something.
>>
>> You can theoretically give each user her own EOF stack. That's
>> probably
>> what you'd need to do, if you really want each user to log in to the
>> db
>> themselves. I've never tried this myself. It could be a memory or
>> performance problem, I'm not sure how well it would work. Maybe others
>> have tried it and have comments.
>
> I assumed that Ricardo was building Cocoa/EOF, not WO apps. So each
> Cocoa/EOF process would have only a single DB user unlike if such a
> thing were implemented in WO.
This is correct, I am doing Cocoa/EOF Apps!
It is now working (code below) but a VERY strange run-log is produced
(I'd never seen it before):
SEM debug: Sybase jdbcInfo() = {NON_NULLABLE_COLUMNS = "T"; DRIVER_NAME
= "jConnect (TM) for JDBC (TM)"; DBMS_NAME = "Sybase SQL Server";
typeInfo = {money = {defaultJDBCType = ("DECIMAL"); createParams = "2";
maxScale = "4"; minScale = "4"; isNullable = "T"; isSearchable = "T";
precision = "19"; }; binary = {createParams = "1"; isNullable = "T";
isSearchable = "T"; precision = "255"; defaultJDBCType = ("BINARY"); };
smalldatetime = {createParams = "0"; isNullable = "T"; isSearchable =
"T"; precision = "16"; defaultJDBCType = ("TIMESTAMP"); }; nchar =
{createParams = "1"; isNullable = "T"; isSearchable = "T"; precision =
"255"; defaultJDBCType = ("CHAR"); }; smallint = {createParams = "0";
isNullable = "T"; isSearchable = "T"; precision = "5"; defaultJDBCType
= ("SMALLINT"); }; numeric = {defaultJDBCType = ("NUMERIC");
createParams = "2"; maxScale = "38"; minScale = "0"; isNullable = "T";
isSearchable = "T"; precision = "38"; }; nvarchar = {createParams =
"1"; isNullable = "T"; isSearchable = "T"; precision = "255";
defaultJDBCType = ("VARCHAR"); }; decimal = {defaultJDBCType =
("DECIMAL"); createParams = "2"; maxScale = "38"; minScale = "0";
isNullable = "T"; isSearchable = "T"; precision = "38"; }; bit =
{createParams = "0"; isNullable = "F"; isSearchable = "T"; precision =
"1"; defaultJDBCType = ("BIT"); }; char = {createParams = "1";
isNullable = "T"; isSearchable = "T"; precision = "255";
defaultJDBCType = ("CHAR"); }; sysname = {createParams = "1";
isNullable = "T"; isSearchable = "T"; precision = "30"; defaultJDBCType
= ("VARCHAR"); }; smallmoney = {defaultJDBCType = ("DECIMAL");
createParams = "2"; maxScale = "4"; minScale = "4"; isNullable = "T";
isSearchable = "T"; precision = "10"; }; image = {createParams = "0";
isNullable = "T"; isSearchable = "F"; precision = "2147483647";
defaultJDBCType = ("LONG VARBINARY"); }; float = {createParams = "0";
isNullable = "T"; isSearchable = "T"; precision = "8"; defaultJDBCType
= ("DOUBLE"); }; double precision = {createParams = "0"; isNullable =
"T"; isSearchable = "T"; precision = "15"; defaultJDBCType =
("DOUBLE"); }; real = {createParams = "0"; isNullable = "T";
isSearchable = "T"; precision = "7"; defaultJDBCType = ("REAL"); };
tinyint = {createParams = "0"; isNullable = "T"; isSearchable = "T";
precision = "3"; defaultJDBCType = ("TINYINT"); }; varbinary =
{createParams = "1"; isNullable = "T"; isSearchable = "T"; precision =
"255"; defaultJDBCType = ("VARBINARY"); }; text = {createParams = "0";
isNullable = "T"; isSearchable = "F"; precision = "2147483647";
defaultJDBCType = ("LONG VARCHAR"); }; int = {createParams = "0";
isNullable = "T"; isSearchable = "T"; precision = "10"; defaultJDBCType
= ("INTEGER"); }; datetime = {createParams = "0"; isNullable = "T";
isSearchable = "T"; precision = "23"; defaultJDBCType = ("TIMESTAMP");
}; varchar = {createParams = "1"; isNullable = "T"; isSearchable = "T";
precision = "255"; defaultJDBCType = ("VARCHAR"); }; };
IDENTIFIER_QUOTE_STRING = """; ANSI92_CONFORMANCE = "ANSI92EntryLevel";
DRIVER_VER = "jConnect (TM) for JDBC(TM)/5.5(Build
25137)/P/EBF10000/JDK12/Sun Jan 6 21:57:04 2002"; STRING_FUNCTIONS =
"ascii,char,concat,difference,insert,length,lcase,ltrim,repeat,right,rtr
im,soundex,space,substring,ucase"; }
The code is:
- (void)windowControllerDidLoadNib:(NSWindowController *) aController
{
[super windowControllerDidLoadNib:aController];
// Add any code here that needs to be executed once the
windowController has loaded the document's window.
id adaptor = [[[[dgDoc dataSource] databaseContext] adaptorContext]
adaptor];
NS_DURING
[adaptor assertConnectionDictionaryIsValid];
NS_HANDLER
[self tryToConnectToDatabase:adaptor];
NS_ENDHANDLER
[dgDoc insert:self];
}
- (void)tryToConnectToDatabase:(id)adaptor;{
[login makeKeyAndOrderFront:self];
}
- (IBAction)setLoginData:(id)sender;{
id adaptor = [[[[dgDoc dataSource] databaseContext] adaptorContext]
adaptor];
id dic = [[adaptor connectionDictionary] mutableClone];
id util = [[NSClassFromString(@"Util") new] autorelease]; // to do
the Java job
[util setLoginValuesToDictionary:[user stringValue] :[passw
stringValue] :dic];
[adaptor setConnectionDictionary:dic];
//NSLog(@"%@, sender = %@, self = %@",dic, sender, self);
NS_DURING
[adaptor assertConnectionDictionaryIsValid];
NS_HANDLER
NSRunAlertPanel(@"Alerta",@"Los datos del usuario NO son
validos",nil,nil,nil);
return;
NS_ENDHANDLER
[login close];
}
Dino
http://homepage.mac.com/strausz
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.