EOFetchSpecification text to number conversion
Hi, I recently changed a table primary key column from NUMBER(6) to NUMBER(12) for a legacy app. After this change I had a lot of bugs and discovered that search queries where returning zero rows. In this legacy app, a lot of fetch specifications are written like this : String pid="80622"; //for the example, in real life this value is read from a text file. new EOFetchSpecification("Patient", EOQualifier.qualifierWithQualifierFormat("nip = " + pid, null), null); With debugging on, this gives the following query which returns 0 rows : SELECT (...) FROM Pat_Patient t0 WHERE t0.nip = ?" withBindings: 1:8.06E8(nip) Now, when using an Integer instead a String : String pid=":80622"; new EOFetchSpecification("Patient", EOQualifier.qualifierWithQualifierFormat("nip = " + Integer.valueOf(pid), null), null); Gives the following query which returns the awaited rows. SELECT (...) FROM Pat_Patient t0 WHERE t0.nip = ?" withBindings: 1:80622(nip) Any idea which could avoid me rewriting the 200+ fetch specifications of this app ? Thanks ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
5.4 can't connect to database
Hi all, I have a problem getting my apps that worked on Tiger to connect to the database in Leopard. I get an exception: [2008-7-7 11:39:17 BOT] main An exception occurred while trying to open a channel: N/A [2008-7-7 11:39:17 BOT] main A fatal exception occurred: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext [EMAIL PROTECTED]: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured. [2008-7-7 11:39:17 BOT] main java.lang.IllegalStateException: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext [EMAIL PROTECTED]: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured. ... On my first attempt to fetch data. However, my databases are running and accessible through the OpenBase manager. I tried downloading the latest JDBC drivers from the OB site, added the Driver: com.openbase.jdbc.ObDriver line to my EOModel, but it did not help. I know this is slightly off topic, but the OB list was not of much assistance. Any thoughts anyone? F My dev setup: 10.5.3 WO 5.4.1 OB 10.0.6 In the EOModel: DB url: jdbc:openbase://127.0.0.1/DBName Driver: com.openbase.jdbc.ObDriver ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: 5.4 can't connect to database
Is it possible for the new firewall setup in Leopard to interfere when using 127.0.0.1? Maybe try disabling it in System Preferences - Security - Firewall by setting Allow all incoming connections? Dave On Jul 7, 2008, at 11:49 AM, Florijan Stamenkovic wrote: Hi all, I have a problem getting my apps that worked on Tiger to connect to the database in Leopard. I get an exception: [2008-7-7 11:39:17 BOT] main An exception occurred while trying to open a channel: N/A [2008-7-7 11:39:17 BOT] main A fatal exception occurred: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext [EMAIL PROTECTED]: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured. [2008-7-7 11:39:17 BOT] main java.lang.IllegalStateException: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext [EMAIL PROTECTED]: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured. ... On my first attempt to fetch data. However, my databases are running and accessible through the OpenBase manager. I tried downloading the latest JDBC drivers from the OB site, added the Driver: com.openbase.jdbc.ObDriver line to my EOModel, but it did not help. I know this is slightly off topic, but the OB list was not of much assistance. Any thoughts anyone? F My dev setup: 10.5.3 WO 5.4.1 OB 10.0.6 In the EOModel: DB url: jdbc:openbase://127.0.0.1/DBName Driver: com.openbase.jdbc.ObDriver ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to [EMAIL PROTECTED] ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: [ANN] WO 5.4.2 javadoc tarball
On Jul 3, 2008, at 1:05 PM, Andrew Lindesay wrote: Hello Daryl; Thanks for that update –– is it possible to get sort of change-log with this so we might know what is changing in the new versions and so can test those changes against our frameworks and apps? We're discussing ways on how to generate this for you guys. We've been trying to get jDiff working again for us, so that should help. It would also be really handy to be able to get a javadoc download for 5.4.3, 5.5 etc... if that is possible. We're also discussing ways to autogenerate this stuff through maven and potentially have an artifiact for each version. cheers. We just posted a downloadable javadoc tarball on ADC for those of you requesting it. We also posted a new nightly build with a WO 5.4.3 branch. ___ Andrew Lindesay www.lindesay.co.nz ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Back To Basics : Databases Active Editing Context
On Jul 6, 2008, at 6:49 PM, Owen McKerrow wrote: OK so we think we probably screwed up implementing MultiLockManager somehow, so heres a couple of more questions to make sure all of our bases are covered : In Session's sleep we have ( terminate looks exactly the same except of course its for terminate ) public void sleep() try { synchronized (ecLockManager) { if (ecLockManager().isLocked()) { ecLockManager().unlock(); } } } finally { super.sleep(); } } This is from my WOSession sub-class (very old code that I have not touched in years): public void awake() { try { ecLockManager().lock(); } catch(Throwable t) { NSLog.err.appendln(** EXCEPTION in WOSession.awake() calling ecLockManager.lock(): + t); } super.awake(); } public void sleep() { // Need to check as this gets called after terminate() when logging out synchronized (ecLockManager) { if (ecLockManager().isLocked()) { try { ecLockManager().unlock(); } catch (Throwable t) { NSLog.err.appendln(** EXCEPTION in WOSession.sleep() calling ecLockManager.unlock(): + t); } } } super.sleep(); } public void terminate() { // Need to make sure this is unlocked so that editing contexts nested in the defaultEditingContext // don't hold locks on it when it gets disposed synchronized (ecLockManager) { if (ecLockManager().isLocked()) { try { ecLockManager().unlock(); } catch (Throwable t) { NSLog.err.appendln(** EXCEPTION in WOSession.terminate() calling ecLockManager.unlock(): + t); } } } super.terminate(); } Your implementation looks fine to me. Should we be using unregisterEditingContext instead of unlock() ? If not why/when should you use unregisterEditingContext ? I very rarely use it. I think I used it once where it was possible that two ECs had been created where I only needed one. This was used to quickly discard the one that was not needed. Chuck On 04/07/2008, at 3:53 PM, Lachlan Deck wrote: On 04/07/2008, at 2:54 PM, Chuck Hill wrote: On Jul 3, 2008, at 9:30 PM, Lachlan Deck wrote: Perhaps a parent ec? Is there any child ecs involved here? I don't recall terribly clearly now as it's been a while... but I remember that for some strange reason an object that I had in the shared editing context didn't localize into the ec that I wanted when attempting to set the relationship - but there was no exception until saveChanges. It might have been when said ec didn't have its sharedEc == null, or invalid locking or something. I recall, when trying to track it down, mucking around with temporarily unlocking shared ec locks and stuff. But I think it turned out to be ensuring that the ec in question didn't properly set its shared ec to null (I think). Sorry I don't recall much more than that. Ah, there you go on about the shared EC again. :-P Someone says it can't/shouldn't be used... just can't help myself... Shared ec, VI, ... I'm just waiting for the next suggestion :-) I had not considered the SEC being involved. That puts a new twist on things. Owen, are you using the SEC? Bear in mind that you *might* be using it unintentionally. e.g., you've declared in your model 'share objects' and/or you're not nullifying your ec's shared ec (which is the usual for your default session context IIRC). with regards, -- Lachlan Deck ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/owen%40uow.edu.au This email sent to [EMAIL PROTECTED] -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
Re: EOFetchSpecification text to number conversion
On Jul 7, 2008, at 7:19 AM, Frédéric JECKER wrote: Hi, I recently changed a table primary key column from NUMBER(6) to NUMBER(12) for a legacy app. After this change I had a lot of bugs and discovered that search queries where returning zero rows. In this legacy app, a lot of fetch specifications are written like this : String pid=80622; //for the example, in real life this value is read from a text file. new EOFetchSpecification(Patient, EOQualifier.qualifierWithQualifierFormat(nip = + pid, null), null); With debugging on, this gives the following query which returns 0 rows : SELECT (...) FROM Pat_Patient t0 WHERE t0.nip = ? withBindings: 1:8.06E8(nip) Now, when using an Integer instead a String : String pid=:80622; new EOFetchSpecification(Patient, EOQualifier.qualifierWithQualifierFormat(nip = + Integer.valueOf(pid), null), null); Gives the following query which returns the awaited rows. SELECT (...) FROM Pat_Patient t0 WHERE t0.nip = ? withBindings: 1:80622(nip) Any idea which could avoid me rewriting the 200+ fetch specifications of this app ? I can't think of any. This is yet another reason to never use qualifierWithQualifierFormat. If you had used EOKeyValueQualifier, you would not have this problem. Just say no to magic strings. Chuck -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: 5.4 can't connect to database
Nope... The firewall is open. Also, the client app can connect to the server app through localhost so it seems to me that the network is OK. Any other thoughts? F On Jul 07, 2008, at 11:58, David Avendasora wrote: Is it possible for the new firewall setup in Leopard to interfere when using 127.0.0.1? Maybe try disabling it in System Preferences - Security - Firewall by setting Allow all incoming connections? Dave On Jul 7, 2008, at 11:49 AM, Florijan Stamenkovic wrote: Hi all, I have a problem getting my apps that worked on Tiger to connect to the database in Leopard. I get an exception: [2008-7-7 11:39:17 BOT] main An exception occurred while trying to open a channel: N/A [2008-7-7 11:39:17 BOT] main A fatal exception occurred: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext [EMAIL PROTECTED]: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured. [2008-7-7 11:39:17 BOT] main java.lang.IllegalStateException: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext [EMAIL PROTECTED]: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured. ... On my first attempt to fetch data. However, my databases are running and accessible through the OpenBase manager. I tried downloading the latest JDBC drivers from the OB site, added the Driver: com.openbase.jdbc.ObDriver line to my EOModel, but it did not help. I know this is slightly off topic, but the OB list was not of much assistance. Any thoughts anyone? F My dev setup: 10.5.3 WO 5.4.1 OB 10.0.6 In the EOModel: DB url: jdbc:openbase://127.0.0.1/DBName Driver: com.openbase.jdbc.ObDriver ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/webobjects% 40avendasora.com This email sent to [EMAIL PROTECTED] ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: [ANN] WO 5.4.2 javadoc tarball
Hi Daryl, Daryl Lee wrote: On Jul 3, 2008, at 1:05 PM, Andrew Lindesay wrote: Thanks for that update –– is it possible to get sort of change-log with this so we might know what is changing in the new versions and so can test those changes against our frameworks and apps? We're discussing ways on how to generate this for you guys. We've been trying to get jDiff working again for us, so that should help. Great news! It would also be really handy to be able to get a javadoc download for 5.4.3, 5.5 etc... if that is possible. We're also discussing ways to autogenerate this stuff through maven and potentially have an artifiact for each version. This would be very useful. Thank you. Kind regards, -- Francis Labrie Saint-Bruno-de-Montarville, Quebec, Canada ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
WOCollapsibleComponentContent is broken on Leopard
Seems like projects with WOCollapsibleComponentContent are broken after deploying to Leopard server (works on local Leopard). Error: java.lang.ClassNotFoundException exception Reason: java.lang.ClassNotFoundException: Cannot find class or component named WOCollapsibleComponentContent in runtime or in a loadable bundle I checked the component exists in the framework, don¹t understand why it can¹t find it. Please help. Thank you. Wen ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: new EOObjectStoreCoordinator and closing database connection afterwards
On Jul 2, 2008, at 4:50 PM, Chuck Hill wrote: On Jul 1, 2008, at 2:41 PM, Klaus Berkling wrote: Hi all. In my application I'm trying to use independent access layer stacks to open multiple database connections to the database. I use this code: EOObjectStoreCoordinator parentObjectStore = new EOObjectStoreCoordinator(); EOEditingContext editingContext = new EOEditingContext(parentObjectStore); setDefaultEditingContext(editingContext); This looks like it's working in that it opens two new connection to the database when I start a new session. As expected. If it is opening two, I'd expect one to be to get the JDBC2 Info and the other for EOF to use to fetch data. As Mike noted earlier, getting EOF to close the JDBC 2 Info connection is tricky. Can you get the DB to log what is sent over each connection? That should indicate if I am right or not. This is what shows up in the mysql log when my client connects: 080707 14:27:10 67 Connect [EMAIL PROTECTED] on zzz 67 Query SET NAMES latin1 67 Query SET character_set_results = NULL 67 Query SHOW VARIABLES 67 Query SHOW COLLATION 67 Query SET autocommit=1 67 Query SHOW VARIABLES LIKE 'tx_isolation' 67 Query SET autocommit=0 68 Connect [EMAIL PROTECTED] on zzz 68 Query SET NAMES latin1 68 Query SET character_set_results = NULL 68 Query SHOW VARIABLES 68 Query SHOW COLLATION 68 Query SET autocommit=1 68 Query SHOW VARIABLES LIKE 'tx_isolation' 68 Query SET autocommit=0 At logout from the client: 080707 14:27:16 67 Prepare [25] UPDATE RS_USER_SESSION SET LOUT_TIME = ? WHERE (USER_SESSION_PK = ? AND LOGIN_GROUP_NUM = ? AND LOGIN_STUDENT_PK is NULL) 67 Execute [25] UPDATE RS_USER_SESSION SET LOUT_TIME = '2008-07-07 14:30:06' WHERE (USER_SESSION_PK = '558446' AND LOGIN_GROUP_NUM = '1' AND LOGIN_STUDENT_PK is NULL) 67 Query commit 67 Query rollback 67 Quit There never is a Quit from 68. Chuck When I'm terminate the session I use this code to close the connection to the database: 'editingContext' is the session 'defaultEditingContext()' EOObjectStoreCoordinator parentObjectStore = (EOObjectStoreCoordinator)(editingContext.parentObjectStore()); NSArray databaseContexts = parentObjectStore.cooperatingObjectStores(); int contextCount = databaseContexts.count(); for (int i = 0; i contextCount; i++) { NSArray channels = ((EODatabaseContext )databaseContexts.objectAtIndex(i)).registeredChannels(); int channelCount = channels.count(); for (int j = 0; j channelCount; j++) { //Make sure the channel you're trying to close isn't performing a transaction. if (! ((EODatabaseChannel )channels .objectAtIndex (j)).adaptorChannel().adaptorContext().hasOpenTransaction()) { ((EODatabaseChannel )channels.objectAtIndex(j)).adaptorChannel().closeChannel(); } } } This closes one of the two database connection, not both. Is there a way to detect the one extra connection or not open the extra connection in the first place? WOnder may have resolved this issue but adding WOnder is a bigger undertaking then I originally expected. Paraphrasing Lou Reed, I just want some of it, not all of it. Thanks kib Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to [EMAIL PROTECTED] -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects Thanks kib Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list
Re: new EOObjectStoreCoordinator and closing database connection afterwards
On Jul 7, 2008, at 2:38 PM, Klaus Berkling wrote: On Jul 2, 2008, at 4:50 PM, Chuck Hill wrote: On Jul 1, 2008, at 2:41 PM, Klaus Berkling wrote: Hi all. In my application I'm trying to use independent access layer stacks to open multiple database connections to the database. I use this code: EOObjectStoreCoordinator parentObjectStore = new EOObjectStoreCoordinator(); EOEditingContext editingContext = new EOEditingContext(parentObjectStore); setDefaultEditingContext(editingContext); This looks like it's working in that it opens two new connection to the database when I start a new session. As expected. If it is opening two, I'd expect one to be to get the JDBC2 Info and the other for EOF to use to fetch data. As Mike noted earlier, getting EOF to close the JDBC 2 Info connection is tricky. Can you get the DB to log what is sent over each connection? That should indicate if I am right or not. This is what shows up in the mysql log when my client connects: 080707 14:27:10 67 Connect [EMAIL PROTECTED] on zzz 67 Query SET NAMES latin1 67 Query SET character_set_results = NULL 67 Query SHOW VARIABLES 67 Query SHOW COLLATION 67 Query SET autocommit=1 67 Query SHOW VARIABLES LIKE 'tx_isolation' 67 Query SET autocommit=0 68 Connect [EMAIL PROTECTED] on zzz 68 Query SET NAMES latin1 68 Query SET character_set_results = NULL 68 Query SHOW VARIABLES 68 Query SHOW COLLATION 68 Query SET autocommit=1 68 Query SHOW VARIABLES LIKE 'tx_isolation' 68 Query SET autocommit=0 At logout from the client: 080707 14:27:16 67 Prepare [25] UPDATE RS_USER_SESSION SET LOUT_TIME = ? WHERE (USER_SESSION_PK = ? AND LOGIN_GROUP_NUM = ? AND LOGIN_STUDENT_PK is NULL) 67 Execute [25] UPDATE RS_USER_SESSION SET LOUT_TIME = '2008-07-07 14:30:06' WHERE (USER_SESSION_PK = '558446' AND LOGIN_GROUP_NUM = '1' AND LOGIN_STUDENT_PK is NULL) 67 Query commit 67 Query rollback 67 Quit There never is a Quit from 68. It is hard to say from that, the jcbc2info request might not get logged like this. But my money is still on the jdbc2info connection. It fits all of the evidence. Mike figured out how to close it, but I don't know where the code is in Wonder. Hmmm, that might have been in Entity Modeler. Mike? Chuck When I'm terminate the session I use this code to close the connection to the database: 'editingContext' is the session 'defaultEditingContext()' EOObjectStoreCoordinator parentObjectStore = (EOObjectStoreCoordinator)(editingContext.parentObjectStore()); NSArray databaseContexts = parentObjectStore.cooperatingObjectStores(); int contextCount = databaseContexts.count(); for (int i = 0; i contextCount; i++) { NSArray channels = ((EODatabaseContext )databaseContexts.objectAtIndex(i)).registeredChannels(); int channelCount = channels.count(); for (int j = 0; j channelCount; j++) { //Make sure the channel you're trying to close isn't performing a transaction. if (! ((EODatabaseChannel )channels .objectAtIndex (j)).adaptorChannel().adaptorContext().hasOpenTransaction()) { ((EODatabaseChannel )channels.objectAtIndex(j)).adaptorChannel().closeChannel(); } } } This closes one of the two database connection, not both. Is there a way to detect the one extra connection or not open the extra connection in the first place? WOnder may have resolved this issue but adding WOnder is a bigger undertaking then I originally expected. Paraphrasing Lou Reed, I just want some of it, not all of it. Thanks kib Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to [EMAIL PROTECTED] -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects Thanks kib Success is not final, failure is not fatal:
Re: [ANN] WO 5.4.2 javadoc tarball
Hello Daryl; That would be really appreciated if you would arrange that. cheers. Thanks for that update –– is it possible to get sort of change-log with this so we might know what is changing in the new versions and so can test those changes against our frameworks and apps? We're discussing ways on how to generate this for you guys. We've been trying to get jDiff working again for us, so that should help. It would also be really handy to be able to get a javadoc download for 5.4.3, 5.5 etc... if that is possible. We're also discussing ways to autogenerate this stuff through maven and potentially have an artifiact for each version. ___ Andrew Lindesay www.lindesay.co.nz ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: EOFetchSpecification text to number conversion
On 08/07/2008, at 2:55 AM, Chuck Hill wrote: On Jul 7, 2008, at 7:19 AM, Frédéric JECKER wrote: I recently changed a table primary key column from NUMBER(6) to NUMBER(12) for a legacy app. After this change I had a lot of bugs and discovered that search queries where returning zero rows. In this legacy app, a lot of fetch specifications are written like this : String pid=80622; //for the example, in real life this value is read from a text file. new EOFetchSpecification(Patient, EOQualifier.qualifierWithQualifierFormat(nip = + pid, null), null); With debugging on, this gives the following query which returns 0 rows : SELECT (...) FROM Pat_Patient t0 WHERE t0.nip = ? withBindings: 1:8.06E8(nip) Now, when using an Integer instead a String : String pid=:80622; new EOFetchSpecification(Patient, EOQualifier.qualifierWithQualifierFormat(nip = + Integer.valueOf(pid), null), null); Gives the following query which returns the awaited rows. SELECT (...) FROM Pat_Patient t0 WHERE t0.nip = ? withBindings: 1:80622(nip) Any idea which could avoid me rewriting the 200+ fetch specifications of this app ? I can't think of any. Well, because you didn't tell it what type of value you had it probably tried to convert it to a double of some kind. If you're going to use qualifierFormat, use the symbols provided. i.e., %d qualifierWithQualifierFormat(nip = %d, new NSArray(pid)); This is yet another reason to never use qualifierWithQualifierFormat. If you had used EOKeyValueQualifier, you would not have this problem. You probably would in the absence of using Integer.valueOf. Just say no to magic strings. Yep, what he said. with regards, -- Lachlan Deck ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: WOCollapsibleComponentContent is broken on Leopard
Hi Wen, On 08/07/2008, at 3:58 AM, Xia, Wen wrote: Seems like projects with WOCollapsibleComponentContent are broken after deploying to Leopard server (works on local Leopard). Error: java.lang.ClassNotFoundException exception Reason: java.lang.ClassNotFoundException: Cannot find class or component named WOCollapsibleComponentContent in runtime or in a loadable bundle I checked the component exists in the framework, don’t understand why it can’t find it. Please help. Thank you. Try embedding your frameworks in the application to ensure that your runtime environment is the same as development. http://wiki.objectstyle.org/confluence/display/WOL/Tutorials http://wiki.objectstyle.org/confluence/display/WOL/Embedding+WOFrameworks with regards, -- Lachlan Deck ___ 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: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]