D2W master-detail handling question

2011-04-06 Thread Markus Ruggiero
I have a one-2-many relationship from master to detail. The user selects a 
detail from a ListDetail page configuration, then clicks edit on a given 
detail. In page configuration EditDetail I have a ERD2WEditToOneRelationship 
as a popup for the toMaster relationship. Now the user thinks/wants to select a 
different master from this popup and switch to that master. Of course this 
makes no sense. And it also makes no sense business wise to re-assign that 
particular detail to a different master. However on new detail the user 
must be able to select the master.

How can I easily distinguish between the cases where the detail is not yet 
saved (in case of new) and where a saved detail is edited so that the 
relationship toMaster can be made edit/non-edit accordingly?

Thanks
---markus---

 ___
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 arch...@mail-archive.com


Direct Connect! Profit!

2011-04-06 Thread Johan Henselmans
I am trying to set up my work environment such as a grown up adult should do, 
with Migrations, and Git and ERAttachment etc, and now the final step:

in

http://wiki.objectstyle.org/confluence/display/WO/Development-Direct+Connect

a man called Chuck Hill claims that this will lead to Profit. 

I checked my Paypal, Google CheckOut, Bitcoin, WorldPay, Digicash, and some 
other accounts, nothing. 

All I get is:

inline: PastedGraphic-1.png
I symlinked the WOA app in build folder in Eclipse to 
/Library/WebServer/Documents/WebObjects/ so as to have the stuff available in 
the WebServer. 

Should I do something extra to make profit?



Johan Henselmans
jo...@netsense.nl





smime.p7s
Description: S/MIME cryptographic signature
 ___
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 arch...@mail-archive.com

EOF create object (temporary ?) for the destination of an inverse relationship

2011-04-06 Thread Dominique Schoenenberger
It's not a problem (my application works correctly) but something a little bit 
odd for me.

First here a description of the relationships of interest:
I have a to-many relationship from A to B and a inverse to-one relationship 
from B to C (A is a sub-entity of C). 

Here what happens:
When I call the relationship method on an instance of A, EOF do a lot of things 
(see trace below): It seams that B objects are created but also ... the 
destination object of the inverse relationship !
(I noticed that because I put a breakpoint in the constructor of C) 

Here some remarks / questions:
   1) Why EOF creates a new object for the inverse relationship. In fact the 
destination of the inverse relationship is the calling object, the instance of 
A !
   2) Instead of creating a object of class A as we would have suspected,  why 
is EOF is creating a object of class of entity D (also a sub-entity of C)
   3) The object created is not inserted in any editing context. I guess it's a 
something temporary.

Is there any means to help EOF like telling which relationship is the inverse ?

Dominique


Trace:

D(C).init() line: 183 
D(_D).init() line: 197
D.init() line: 18 
NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not 
available [native method]   
NativeConstructorAccessorImpl.newInstance(Object[]) line: 39
DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27
ConstructorT.newInstance(Object...) line: 513 
_NSUtilities.instantiateObjectWithConstructor(Constructor, Class, Object[], 
boolean, boolean) line: 633 
ERXEntityClassDescription(EOEntityClassDescription).createInstanceWithEditingContext(EOEditingContext,
 EOGlobalID) line: 242
ERXEntityClassDescription.createInstanceWithEditingContext(EOEditingContext, 
EOGlobalID) line: 754  
EORelationship._deferredFault() line: 1904  
_EODBCtxEntityInfo.computeRelationshipInfoForEntityObjectRow(EOEntity, Object, 
NSDictionary) line: 6704 
_EODBCtxEntityInfo.infoForEntityObjectRow(EOEntity, EOEnterpriseObject, 
NSDictionary) line: 6744
EODatabaseContext.initializeObjectRowEntityEditingContext(EOEnterpriseObject, 
NSDictionary, EOEntity, EOEditingContext) line: 2228  
EODatabaseContext.initializeObject(EOEnterpriseObject, EOGlobalID, 
EOEditingContext) line: 3581 
ERXObjectStoreCoordinator(EOObjectStoreCoordinator).initializeObject(EOEnterpriseObject,
 EOGlobalID, EOEditingContext) line: 597
ERXEC(EOEditingContext).initializeObject(EOEnterpriseObject, EOGlobalID, 
EOEditingContext) line: 3768   
ERXEC.initializeObject(EOEnterpriseObject, EOGlobalID, EOEditingContext) line: 
1141 
EODatabaseChannel$_EODatabaseChannelFetchResult.initializeObjects(NSArray, 
EOEditingContext, EODatabaseContext) line: 496   
EODatabaseContext._objectsWithFetchSpecificationEditingContext(EOFetchSpecification,
 EOEditingContext) line: 3090   
EODatabaseContext.objectsWithFetchSpecification(EOFetchSpecification, 
EOEditingContext) line: 3195  
ERXObjectStoreCoordinator(EOObjectStoreCoordinator).objectsWithFetchSpecification(EOFetchSpecification,
 EOEditingContext) line: 488 
ERXEC(EOEditingContext).objectsWithFetchSpecification(EOFetchSpecification, 
EOEditingContext) line: 4069
ERXEC.objectsWithFetchSpecification(EOFetchSpecification, EOEditingContext) 
line: 1206  
EODatabaseContext.objectsForSourceGlobalID(EOGlobalID, String, 
EOEditingContext) line: 4084 
ERXObjectStoreCoordinator(EOObjectStoreCoordinator).objectsForSourceGlobalID(EOGlobalID,
 String, EOEditingContext) line: 634
ERXEC(EOEditingContext).objectsForSourceGlobalID(EOGlobalID, String, 
EOEditingContext) line: 3923   
ERXEC.objectsForSourceGlobalID(EOGlobalID, String, EOEditingContext) line: 1169 
EODatabaseContext._fireArrayFault(Object) line: 4245
EOAccessArrayFaultHandler.completeInitializationOfObject(Object) line: 77   
_EOCheapCopyMutableArray.willRead() line: 37
_EOCheapCopyMutableArray.objectEnumerator() line: 96 
___
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 arch...@mail-archive.com


Re: Direct Connect! Profit!

2011-04-06 Thread Pascal Robert
Probably that wotaskd is only listening to localhost (127.0.0.1) but your 
application is not. Try to launch both wotaskd and your app with -WOHost 
localhost

 I am trying to set up my work environment such as a grown up adult should do, 
 with Migrations, and Git and ERAttachment etc, and now the final step:
 
 in
 
 http://wiki.objectstyle.org/confluence/display/WO/Development-Direct+Connect
 
 a man called Chuck Hill claims that this will lead to Profit. 
 
 I checked my Paypal, Google CheckOut, Bitcoin, WorldPay, Digicash, and some 
 other accounts, nothing. 
 
 All I get is:
 
 PastedGraphic-1.png
 I symlinked the WOA app in build folder in Eclipse to 
 /Library/WebServer/Documents/WebObjects/ so as to have the stuff available in 
 the WebServer. 
 
 Should I do something extra to make profit?
 
 
 
 Johan Henselmans
 jo...@netsense.nl
 
 
 
 ___
 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/probert%40macti.ca
 
 This email sent to prob...@macti.ca

 ___
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 arch...@mail-archive.com


Migrations not executed at startup problem

2011-04-06 Thread Miguel Angel Torres Avila
Hi all,

I am trying to implement Migrations in an existing Application.

I followed the instructions in this page:

http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html

and this one 

http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html

I think the steps are:

1. Modify properties file:

# Migrations
er.migration.migrateAtStartup=true
er.migration.createTablesIfNecessary=true
er.migration.modelNames=DInAdminEOModel
er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true

DInAdminEOModel.InitialMigrationVersion=1
DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel 

2. Create class com.toracom.app.migration.DInAdminEOModel1.java

/// BEGIN CLASS
package com.toracom.app.migration;

import com.webobjects.eoaccess.EOAdaptorChannel;
import com.webobjects.eoaccess.EOModel;
import com.webobjects.eocontrol.EOEditingContext;
import com.webobjects.foundation.NSArray;

import er.extensions.migration.ERXMigration;
import er.extensions.migration.ERXModelVersion;

public class DInAdminEOModel1 extends ERXMigration {
public NSArrayERXModelVersion modelDependencies() { 
 return null; 
   } 


@Override
public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
channel, EOModel model) throws Throwable {

}

@Override
public void downgrade(EOEditingContext editingContext,  
EOAdaptorChannel channel, EOModel model) throws Throwable {
// TODO Auto-generated method stub

} 
}

// END CLASS


3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file

ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT NULL;


When I run my application never get the SQL code executed. In the Application 
class I load a Parametros entity but I get the following error

Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression: 
com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT 
t0.directorio_raiz_procesamiento_cfd, t0.email_formato, 
t0.encoding_archivo_fuente, t0.encoding_escritura_cfd, 
t0.encoding_escritura_div_sol, t0.encoding_escritura_xml_co, 
t0.encoding_escritura_xml_impresion, t0.encoding_lectura_jaxb, 
t0.encoding_obtencion_co, t0.encoding_trans_co, t0.fh, t0.fhc, 
t0.formato_fecha_dhtmlxgrid, t0.formato_numero_registro_bd, 
t0.formato_numero_registro_bd_corto, t0.fsh, t0.fshnm, t0.iva, t0.logs_debug, 
t0.logs_path, t0.logs_stdout, t0.metodo_impresion, 
t0.modulo_cfdivault_habilitado, t0.moneda_id, t0.nd, t0.ne, t0.nm, 
t0.nombre_aplicacion, t0.np, t0.ntc, t0.parametros_id, t0.retraso_daemon, 
t0.rfc_fisica, t0.rfc_moral, t0.sistema_inicializado, t0.url_birt_viewer, 
t0.version_comprobante FROM parametros t0 withBindings: 
Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  === Rollback Internal 
Transaction
ERROR: column t0.modulo_cfdivault_habilitado does not existat 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)
at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:194)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)


Because the modulo_cfdivault_habilitado column does not exist, so the 
migration's file is never executed.

Am I missing something, maybe a missing Framework?

Thanks in advance.

___
Ing. Miguel Angel Torres Avila
Director General
Tel: +52 (33) 3367 1892
Cel: +52 (33) 3106 8758
E-mail: mig...@toracom.net
www.toracom.net

Antes de imprimir, piense en el Medio Ambiente. Before printing think about the 
Environment. Avant d'imprimer, pensez à l'Environnement 
 


 ___
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 arch...@mail-archive.com

Re: Trouble with form

2011-04-06 Thread Chuck Hill
Yes, don't do that.  :-)  Use UTF-8.  I don't know of any public constant, 
only the private NSStringUtilities.UTF8_ENCODING


On Apr 6, 2011, at 9:03 AM, Amedeo Mantica wrote:

 this for example:
 in my Application Class
 
 ERXMessageEncoding.setDefaultEncodingForAllLanguages(UTF8);
 
 Regards
 Amedeo
 
 
 On 05/apr/2011, at 21.47, Chuck Hill wrote:
 
 You need to have all of your application consistent in the form value 
 encoding.  Make sure that you are not using the obsolete string constant 
 UTF8 anywhere.  The wiki has more details.
 
 Chuck
 
 On Apr 5, 2011, at 3:43 AM, Amedeo Mantica wrote:
 
 After moving my app from sessions IDs stored in URL to Cookie, I get this 
 when submitting a form
 
 Any suggestion?
 
 Amed
 
 
 
 Error:  java.lang.IllegalStateException: Default form value encoding 
 was changed after parsing multi-part form. Form values will be lost.
 Reason: Default form value encoding was changed after parsing 
 multi-part form. Form values will be lost.
 Stack trace:
 FileLine#   Method  Package
 WORequest.java  767 setDefaultFormValueEncoding 
 com.webobjects.appserver
 ERXMessageEncoding.java 168 setDefaultFormValueEncodingToRequest
 er.extensions.appserver
 ERXMessageEncoding.java 173 setDefaultFormValueEncodingToRequest
 er.extensions.appserver
 ERXSession.java 540 takeValuesFromRequest   er.extensions.appserver
 WOApplication.java  1724takeValuesFromRequest   com.webobjects.appserver
 ERXAjaxApplication.java 78  takeValuesFromRequest   
 er.extensions.appserver.ajax
 WOComponentRequestHandler.java  199 _dispatchWithPreparedPage   
 com.webobjects.appserver._private
 WOComponentRequestHandler.java  298 _dispatchWithPreparedSession
 com.webobjects.appserver._private
 WOComponentRequestHandler.java  332 
 _dispatchWithPreparedApplicationcom.webobjects.appserver._private
 WOComponentRequestHandler.java  369 _handleRequest  
 com.webobjects.appserver._private
 WOComponentRequestHandler.java  442 handleRequest   
 com.webobjects.appserver._private
 WOApplication.java  1687dispatchRequest com.webobjects.appserver
 ERXApplication.java 1984dispatchRequestImmediately  
 er.extensions.appserver
 ERXApplication.java 1949dispatchRequest er.extensions.appserver
 WOWorkerThread.java 144 runOnce com.webobjects.appserver._private
 WOWorkerThread.java 226 run com.webobjects.appserver._private
 Thread.java 680 run
 
 
 ___
 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 ch...@global-village.net
 
 -- 
 Chuck Hill Senior Consultant / VP Development
 
 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/chill%40global-village.net
 
 This email sent to ch...@global-village.net

-- 
Chuck Hill Senior Consultant / VP Development

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









smime.p7s
Description: S/MIME cryptographic signature
 ___
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 arch...@mail-archive.com

Re: D2W master-detail handling question

2011-04-06 Thread David Holt
Hi Markus,

On 2011-04-05, at 11:14 PM, Markus Ruggiero wrote:

 I have a one-2-many relationship from master to detail. The user selects 
 a detail from a ListDetail page configuration, then clicks edit on a 
 given detail. In page configuration EditDetail I have a 
 ERD2WEditToOneRelationship as a popup for the toMaster relationship. Now the 
 user thinks/wants to select a different master from this popup and switch 
 to that master. Of course this makes no sense. And it also makes no sense 
 business wise to re-assign that particular detail to a different master. 
 However on new detail the user must be able to select the master.

Change your PropertyLevel component to an uneditable string for that 
relationship in the edit page configuration.

In the create page configuration leave it as is.

David


 
 How can I easily distinguish between the cases where the detail is not yet 
 saved (in case of new) and where a saved detail is edited so that the 
 relationship toMaster can be made edit/non-edit accordingly?

Use 2 different page configurations?


 
 Thanks
 ---markus---
 
 ___
 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/programmingosx%40mac.com
 
 This email sent to programming...@mac.com

 ___
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 arch...@mail-archive.com


Re: Trouble with form

2011-04-06 Thread Amedeo Mantica
ok
thanks

On 06/apr/2011, at 18.59, Chuck Hill wrote:

 Yes, don't do that.  :-)  Use UTF-8.  I don't know of any public constant, 
 only the private NSStringUtilities.UTF8_ENCODING
 
 
 On Apr 6, 2011, at 9:03 AM, Amedeo Mantica wrote:
 
 this for example:
 in my Application Class
 
 ERXMessageEncoding.setDefaultEncodingForAllLanguages(UTF8);
 
 Regards
 Amedeo
 
 
 On 05/apr/2011, at 21.47, Chuck Hill wrote:
 
 You need to have all of your application consistent in the form value 
 encoding.  Make sure that you are not using the obsolete string constant 
 UTF8 anywhere.  The wiki has more details.
 
 Chuck
 
 On Apr 5, 2011, at 3:43 AM, Amedeo Mantica wrote:
 
 After moving my app from sessions IDs stored in URL to Cookie, I get this 
 when submitting a form
 
 Any suggestion?
 
 Amed
 
 
 
 Error: java.lang.IllegalStateException: Default form value encoding 
 was changed after parsing multi-part form. Form values will be lost.
 Reason:Default form value encoding was changed after parsing 
 multi-part form. Form values will be lost.
 Stack trace:   
 File   Line#   Method  Package
 WORequest.java 767 setDefaultFormValueEncoding 
 com.webobjects.appserver
 ERXMessageEncoding.java168 setDefaultFormValueEncodingToRequest
 er.extensions.appserver
 ERXMessageEncoding.java173 setDefaultFormValueEncodingToRequest
 er.extensions.appserver
 ERXSession.java540 takeValuesFromRequest   er.extensions.appserver
 WOApplication.java 1724takeValuesFromRequest   com.webobjects.appserver
 ERXAjaxApplication.java78  takeValuesFromRequest   
 er.extensions.appserver.ajax
 WOComponentRequestHandler.java 199 _dispatchWithPreparedPage   
 com.webobjects.appserver._private
 WOComponentRequestHandler.java 298 _dispatchWithPreparedSession
 com.webobjects.appserver._private
 WOComponentRequestHandler.java 332 
 _dispatchWithPreparedApplicationcom.webobjects.appserver._private
 WOComponentRequestHandler.java 369 _handleRequest  
 com.webobjects.appserver._private
 WOComponentRequestHandler.java 442 handleRequest   
 com.webobjects.appserver._private
 WOApplication.java 1687dispatchRequest com.webobjects.appserver
 ERXApplication.java1984dispatchRequestImmediately  
 er.extensions.appserver
 ERXApplication.java1949dispatchRequest er.extensions.appserver
 WOWorkerThread.java144 runOnce 
 com.webobjects.appserver._private
 WOWorkerThread.java226 run 
 com.webobjects.appserver._private
 Thread.java680 run
 
 
 ___
 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 ch...@global-village.net
 
 -- 
 Chuck Hill Senior Consultant / VP Development
 
 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/chill%40global-village.net
 
 This email sent to ch...@global-village.net
 
 -- 
 Chuck Hill Senior Consultant / VP Development
 
 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 arch...@mail-archive.com

Re: Migrations not executed at startup problem

2011-04-06 Thread Chuck Hill
Is this a full Wonder app, extending ERXApplication?  If not, you need to 
initiate the migration:

if (ERXMigrator.shouldMigrateAtStartup())
{
try
{
migrator().migrateToLatest();
}
catch (ERXMigrationFailedException e)
{
// It might be a missing plugin problem
new 
ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
throw e;
}
}

Chuck


On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:

 Hi all,
 
 I am trying to implement Migrations in an existing Application.
 
 I followed the instructions in this page:
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html
 
 and this one 
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html
 
 I think the steps are:
 
 1. Modify properties file:
 
 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true
 
 DInAdminEOModel.InitialMigrationVersion=1
 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel
  
 
 2. Create class com.toracom.app.migration.DInAdminEOModel1.java
 
 /// BEGIN CLASS
 package com.toracom.app.migration;
 
 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;
 
 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;
 
 public class DInAdminEOModel1 extends ERXMigration {
   public NSArrayERXModelVersion modelDependencies() { 
return null; 
  } 
 
 
   @Override
   public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
 channel, EOModel model) throws Throwable {
   
   }
 
   @Override
   public void downgrade(EOEditingContext editingContext,  
 EOAdaptorChannel channel, EOModel model) throws Throwable {
   // TODO Auto-generated method stub
   
   } 
 }
 
 // END CLASS
 
 
 3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file
 
 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
 UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
 ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT NULL;
 
 
 When I run my application never get the SQL code executed. In the Application 
 class I load a Parametros entity but I get the following error
 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression: 
 com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT 
 t0.directorio_raiz_procesamiento_cfd, t0.email_formato, 
 t0.encoding_archivo_fuente, t0.encoding_escritura_cfd, 
 t0.encoding_escritura_div_sol, t0.encoding_escritura_xml_co, 
 t0.encoding_escritura_xml_impresion, t0.encoding_lectura_jaxb, 
 t0.encoding_obtencion_co, t0.encoding_trans_co, t0.fh, t0.fhc, 
 t0.formato_fecha_dhtmlxgrid, t0.formato_numero_registro_bd, 
 t0.formato_numero_registro_bd_corto, t0.fsh, t0.fshnm, t0.iva, t0.logs_debug, 
 t0.logs_path, t0.logs_stdout, t0.metodo_impresion, 
 t0.modulo_cfdivault_habilitado, t0.moneda_id, t0.nd, t0.ne, t0.nm, 
 t0.nombre_aplicacion, t0.np, t0.ntc, t0.parametros_id, t0.retraso_daemon, 
 t0.rfc_fisica, t0.rfc_moral, t0.sistema_inicializado, t0.url_birt_viewer, 
 t0.version_comprobante FROM parametros t0 withBindings: 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  === Rollback Internal 
 Transaction
 ERROR: column t0.modulo_cfdivault_habilitado does not existat 
 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:194)
 at 
 org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
 at 
 org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)
 
 
 Because the modulo_cfdivault_habilitado column does not exist, so the 
 migration's file is never executed.
 
 Am I missing something, maybe a missing Framework?
 
 Thanks in advance.
 
 
 ___
 Ing. Miguel Angel Torres Avila
 Director General
 Tel: +52 (33) 3367 1892
 Cel: +52 (33) 3106 8758
 E-mail: mig...@toracom.net
 www.toracom.net
 
 Antes de imprimir, piense en el Medio Ambiente. Before printing think about 
 the Environment. Avant d'imprimer, pensez à l'Environnement 
  
 
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 

Re: Migrations not executed at startup problem

2011-04-06 Thread Paul D Yu
Miguel

You will need to call the external sql script from inside of your 
Migration.java file.

@Override
public void upgrade(EOEditingContext editingContext, ERXMigrationDatabase 
database) throws Throwable {

ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(),
 DInAdminEOModel1_Postgresql_Upgrade.migration, DIModelFramework);
}

Something like that?

Paul
On Apr 6, 2011, at 1:07 PM, Chuck Hill wrote:

 Is this a full Wonder app, extending ERXApplication?  If not, you need to 
 initiate the migration:
 
 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new 
 ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }
 
 Chuck
 
 
 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:
 
 Hi all,
 
 I am trying to implement Migrations in an existing Application.
 
 I followed the instructions in this page:
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html
 
 and this one 
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html
 
 I think the steps are:
 
 1. Modify properties file:
 
 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true
 
 DInAdminEOModel.InitialMigrationVersion=1
 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel
  
 
 2. Create class com.toracom.app.migration.DInAdminEOModel1.java
 
 /// BEGIN CLASS
 package com.toracom.app.migration;
 
 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;
 
 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;
 
 public class DInAdminEOModel1 extends ERXMigration {
  public NSArrayERXModelVersion modelDependencies() { 
   return null; 
 } 
 
 
  @Override
  public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
 channel, EOModel model) throws Throwable {
  
  }
 
  @Override
  public void downgrade(EOEditingContext editingContext,  
 EOAdaptorChannel channel, EOModel model) throws Throwable {
  // TODO Auto-generated method stub
  
  } 
 }
 
 // END CLASS
 
 
 3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file
 
 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
 UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
 ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT NULL;
 
 
 When I run my application never get the SQL code executed. In the 
 Application class I load a Parametros entity but I get the following error
 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression: 
 com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT 
 t0.directorio_raiz_procesamiento_cfd, t0.email_formato, 
 t0.encoding_archivo_fuente, t0.encoding_escritura_cfd, 
 t0.encoding_escritura_div_sol, t0.encoding_escritura_xml_co, 
 t0.encoding_escritura_xml_impresion, t0.encoding_lectura_jaxb, 
 t0.encoding_obtencion_co, t0.encoding_trans_co, t0.fh, t0.fhc, 
 t0.formato_fecha_dhtmlxgrid, t0.formato_numero_registro_bd, 
 t0.formato_numero_registro_bd_corto, t0.fsh, t0.fshnm, t0.iva, 
 t0.logs_debug, t0.logs_path, t0.logs_stdout, t0.metodo_impresion, 
 t0.modulo_cfdivault_habilitado, t0.moneda_id, t0.nd, t0.ne, t0.nm, 
 t0.nombre_aplicacion, t0.np, t0.ntc, t0.parametros_id, t0.retraso_daemon, 
 t0.rfc_fisica, t0.rfc_moral, t0.sistema_inicializado, t0.url_birt_viewer, 
 t0.version_comprobante FROM parametros t0 withBindings: 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  === Rollback Internal 
 Transaction
 ERROR: column t0.modulo_cfdivault_habilitado does not existat 
 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:194)
 at 
 org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
 at 
 org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)
 
 
 Because the modulo_cfdivault_habilitado column does not exist, so the 
 migration's file is never executed.
 
 Am I missing something, maybe a missing Framework?
 
 Thanks in advance.
 
 
 ___
 Ing. 

Re: Migrations not executed at startup problem

2011-04-06 Thread Miguel Angel Torres Avila
Thanks Chuck

The Application class extends ERXApplication.

But I just tried the code and the 

 migrator().migrateToLatest();


line of code is reached but nothing happens.

I just added a System.out.println like this in the 
com.toracom.app.migration.DInAdminEOModel1.java class

@Override
public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
channel, EOModel model) throws Throwable {
System.out.println(Inside migrations);
}

But it is never called.

So I have a configuration problem somewhere, maybe I misspelled something.

I will doble checked everything.

On Apr 6, 2011, at 12:07 PM, Chuck Hill wrote:

 Is this a full Wonder app, extending ERXApplication?  If not, you need to 
 initiate the migration:
 
 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new 
 ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }
 
 Chuck
 
 
 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:
 
 Hi all,
 
 I am trying to implement Migrations in an existing Application.
 
 I followed the instructions in this page:
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html
 
 and this one 
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html
 
 I think the steps are:
 
 1. Modify properties file:
 
 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true
 
 DInAdminEOModel.InitialMigrationVersion=1
 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel
  
 
 2. Create class com.toracom.app.migration.DInAdminEOModel1.java
 
 /// BEGIN CLASS
 package com.toracom.app.migration;
 
 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;
 
 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;
 
 public class DInAdminEOModel1 extends ERXMigration {
  public NSArrayERXModelVersion modelDependencies() { 
   return null; 
 } 
 
 
  @Override
  public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
 channel, EOModel model) throws Throwable {
  
  }
 
  @Override
  public void downgrade(EOEditingContext editingContext,  
 EOAdaptorChannel channel, EOModel model) throws Throwable {
  // TODO Auto-generated method stub
  
  } 
 }
 
 // END CLASS
 
 
 3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file
 
 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
 UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
 ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT NULL;
 
 
 When I run my application never get the SQL code executed. In the 
 Application class I load a Parametros entity but I get the following error
 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression: 
 com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT 
 t0.directorio_raiz_procesamiento_cfd, t0.email_formato, 
 t0.encoding_archivo_fuente, t0.encoding_escritura_cfd, 
 t0.encoding_escritura_div_sol, t0.encoding_escritura_xml_co, 
 t0.encoding_escritura_xml_impresion, t0.encoding_lectura_jaxb, 
 t0.encoding_obtencion_co, t0.encoding_trans_co, t0.fh, t0.fhc, 
 t0.formato_fecha_dhtmlxgrid, t0.formato_numero_registro_bd, 
 t0.formato_numero_registro_bd_corto, t0.fsh, t0.fshnm, t0.iva, 
 t0.logs_debug, t0.logs_path, t0.logs_stdout, t0.metodo_impresion, 
 t0.modulo_cfdivault_habilitado, t0.moneda_id, t0.nd, t0.ne, t0.nm, 
 t0.nombre_aplicacion, t0.np, t0.ntc, t0.parametros_id, t0.retraso_daemon, 
 t0.rfc_fisica, t0.rfc_moral, t0.sistema_inicializado, t0.url_birt_viewer, 
 t0.version_comprobante FROM parametros t0 withBindings: 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  === Rollback Internal 
 Transaction
 ERROR: column t0.modulo_cfdivault_habilitado does not existat 
 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:194)
 at 
 org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
 at 
 org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)
 
 
 Because the 

Re: Migrations not executed at startup problem

2011-04-06 Thread Miguel Angel Torres Avila
Thanks Paul

For some reason the code inside the upgrade class is never called.

I think I should mistyped something. I am checking now.


On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:

 Miguel
 
 You will need to call the external sql script from inside of your 
 Migration.java file.
 
 @Override
 public void upgrade(EOEditingContext editingContext, ERXMigrationDatabase 
 database) throws Throwable {
 
 ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(),
  DInAdminEOModel1_Postgresql_Upgrade.migration, DIModelFramework);
 }
 
 Something like that?
 
 Paul
 On Apr 6, 2011, at 1:07 PM, Chuck Hill wrote:
 
 Is this a full Wonder app, extending ERXApplication?  If not, you need to 
 initiate the migration:
 
 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new 
 ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }
 
 Chuck
 
 
 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:
 
 Hi all,
 
 I am trying to implement Migrations in an existing Application.
 
 I followed the instructions in this page:
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html
 
 and this one 
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html
 
 I think the steps are:
 
 1. Modify properties file:
 
 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true
 
 DInAdminEOModel.InitialMigrationVersion=1
 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel
  
 
 2. Create class com.toracom.app.migration.DInAdminEOModel1.java
 
 /// BEGIN CLASS
 package com.toracom.app.migration;
 
 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;
 
 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;
 
 public class DInAdminEOModel1 extends ERXMigration {
 public NSArrayERXModelVersion modelDependencies() { 
  return null; 
} 
 
 
 @Override
 public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
 channel, EOModel model) throws Throwable {
 
 }
 
 @Override
 public void downgrade(EOEditingContext editingContext,  
 EOAdaptorChannel channel, EOModel model) throws Throwable {
 // TODO Auto-generated method stub
 
 } 
 }
 
 // END CLASS
 
 
 3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file
 
 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
 UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
 ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT 
 NULL;
 
 
 When I run my application never get the SQL code executed. In the 
 Application class I load a Parametros entity but I get the following error
 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression: 
 com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT 
 t0.directorio_raiz_procesamiento_cfd, t0.email_formato, 
 t0.encoding_archivo_fuente, t0.encoding_escritura_cfd, 
 t0.encoding_escritura_div_sol, t0.encoding_escritura_xml_co, 
 t0.encoding_escritura_xml_impresion, t0.encoding_lectura_jaxb, 
 t0.encoding_obtencion_co, t0.encoding_trans_co, t0.fh, t0.fhc, 
 t0.formato_fecha_dhtmlxgrid, t0.formato_numero_registro_bd, 
 t0.formato_numero_registro_bd_corto, t0.fsh, t0.fshnm, t0.iva, 
 t0.logs_debug, t0.logs_path, t0.logs_stdout, t0.metodo_impresion, 
 t0.modulo_cfdivault_habilitado, t0.moneda_id, t0.nd, t0.ne, t0.nm, 
 t0.nombre_aplicacion, t0.np, t0.ntc, t0.parametros_id, t0.retraso_daemon, 
 t0.rfc_fisica, t0.rfc_moral, t0.sistema_inicializado, t0.url_birt_viewer, 
 t0.version_comprobante FROM parametros t0 withBindings: 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  === Rollback Internal 
 Transaction
 ERROR: column t0.modulo_cfdivault_habilitado does not existat 
 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:194)
 at 
 org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
 at 
 org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)
 
 
 Because the 

Re: Direct Connect! Profit!

2011-04-06 Thread Johan Henselmans

On 6 apr 2011, at 15:50, Pascal Robert wrote:

 Probably that wotaskd is only listening to localhost (127.0.0.1) but your 
 application is not. Try to launch both wotaskd and your app with -WOHost 
 localhost


Spot on. Profit!

(I'll change the wiki accordingly).

 
 I am trying to set up my work environment such as a grown up adult should 
 do, with Migrations, and Git and ERAttachment etc, and now the final step:
 
 in
 
 http://wiki.objectstyle.org/confluence/display/WO/Development-Direct+Connect
 
 a man called Chuck Hill claims that this will lead to Profit. 
 
 I checked my Paypal, Google CheckOut, Bitcoin, WorldPay, Digicash, and some 
 other accounts, nothing. 
 
 All I get is:
 
 PastedGraphic-1.png
 I symlinked the WOA app in build folder in Eclipse to 
 /Library/WebServer/Documents/WebObjects/ so as to have the stuff available 
 in the WebServer. 
 
 Should I do something extra to make profit?
 
 
 
 Johan Henselmans
 jo...@netsense.nl
 
 
 
 ___
 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/probert%40macti.ca
 
 This email sent to prob...@macti.ca
 

Johan Henselmans
jo...@netsense.nl





smime.p7s
Description: S/MIME cryptographic signature
 ___
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 arch...@mail-archive.com

Re: Migrations not executed at startup problem

2011-04-06 Thread Mike Schrag
More than likely you've already run once, and the migration did nothing, so it 
succeeded, and it's not going to run it again unless you modify the data in the 
migration version table to reset it back.

On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote:

 Thanks Paul
 
 For some reason the code inside the upgrade class is never called.
 
 I think I should mistyped something. I am checking now.
 
 
 On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:
 
 Miguel
 
 You will need to call the external sql script from inside of your 
 Migration.java file.
 
 @Override
 public void upgrade(EOEditingContext editingContext, 
 ERXMigrationDatabase database) throws Throwable {
 
 ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(),
  DInAdminEOModel1_Postgresql_Upgrade.migration, DIModelFramework);
 }
 
 Something like that?
 
 Paul
 On Apr 6, 2011, at 1:07 PM, Chuck Hill wrote:
 
 Is this a full Wonder app, extending ERXApplication?  If not, you need to 
 initiate the migration:
 
 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new 
 ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }
 
 Chuck
 
 
 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:
 
 Hi all,
 
 I am trying to implement Migrations in an existing Application.
 
 I followed the instructions in this page:
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html
 
 and this one 
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html
 
 I think the steps are:
 
 1. Modify properties file:
 
 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true
 
 DInAdminEOModel.InitialMigrationVersion=1
 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel
  
 
 2. Create class com.toracom.app.migration.DInAdminEOModel1.java
 
 /// BEGIN CLASS
 package com.toracom.app.migration;
 
 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;
 
 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;
 
 public class DInAdminEOModel1 extends ERXMigration {
public NSArrayERXModelVersion modelDependencies() { 
 return null; 
   } 
 
 
@Override
public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
 channel, EOModel model) throws Throwable {

}
 
@Override
public void downgrade(EOEditingContext editingContext,  
 EOAdaptorChannel channel, EOModel model) throws Throwable {
// TODO Auto-generated method stub

} 
 }
 
 // END CLASS
 
 
 3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file
 
 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
 UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
 ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT 
 NULL;
 
 
 When I run my application never get the SQL code executed. In the 
 Application class I load a Parametros entity but I get the following error
 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression: 
 com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT 
 t0.directorio_raiz_procesamiento_cfd, t0.email_formato, 
 t0.encoding_archivo_fuente, t0.encoding_escritura_cfd, 
 t0.encoding_escritura_div_sol, t0.encoding_escritura_xml_co, 
 t0.encoding_escritura_xml_impresion, t0.encoding_lectura_jaxb, 
 t0.encoding_obtencion_co, t0.encoding_trans_co, t0.fh, t0.fhc, 
 t0.formato_fecha_dhtmlxgrid, t0.formato_numero_registro_bd, 
 t0.formato_numero_registro_bd_corto, t0.fsh, t0.fshnm, t0.iva, 
 t0.logs_debug, t0.logs_path, t0.logs_stdout, t0.metodo_impresion, 
 t0.modulo_cfdivault_habilitado, t0.moneda_id, t0.nd, t0.ne, t0.nm, 
 t0.nombre_aplicacion, t0.np, t0.ntc, t0.parametros_id, t0.retraso_daemon, 
 t0.rfc_fisica, t0.rfc_moral, t0.sistema_inicializado, t0.url_birt_viewer, 
 t0.version_comprobante FROM parametros t0 withBindings: 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  === Rollback Internal 
 Transaction
 ERROR: column t0.modulo_cfdivault_habilitado does not existat 
 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)
 at 
 org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343)
 at 
 

Re: Migrations not executed at startup problem

2011-04-06 Thread Paul D Yu
Look at the _dbupdater table in your database.

It should have a row in there with your EOModel name in it;  set the version 
back to null.

Paul

On Apr 6, 2011, at 1:43 PM, Mike Schrag wrote:

 More than likely you've already run once, and the migration did nothing, so 
 it succeeded, and it's not going to run it again unless you modify the data 
 in the migration version table to reset it back.
 
 On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote:
 
 Thanks Paul
 
 For some reason the code inside the upgrade class is never called.
 
 I think I should mistyped something. I am checking now.
 
 
 On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:
 
 Miguel
 
 You will need to call the external sql script from inside of your 
 Migration.java file.
 
 @Override
 public void upgrade(EOEditingContext editingContext, 
 ERXMigrationDatabase database) throws Throwable {
 
 ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(),
  DInAdminEOModel1_Postgresql_Upgrade.migration, DIModelFramework);
 }
 
 Something like that?
 
 Paul
 On Apr 6, 2011, at 1:07 PM, Chuck Hill wrote:
 
 Is this a full Wonder app, extending ERXApplication?  If not, you need 
 to initiate the migration:
 
 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new 
 ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }
 
 Chuck
 
 
 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:
 
 Hi all,
 
 I am trying to implement Migrations in an existing Application.
 
 I followed the instructions in this page:
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html
 
 and this one 
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html
 
 I think the steps are:
 
 1. Modify properties file:
 
 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true
 
 DInAdminEOModel.InitialMigrationVersion=1
 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel
 
 2. Create class com.toracom.app.migration.DInAdminEOModel1.java
 
 /// BEGIN CLASS
 package com.toracom.app.migration;
 
 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;
 
 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;
 
 public class DInAdminEOModel1 extends ERXMigration {
   public NSArrayERXModelVersion modelDependencies() { 
return null; 
  } 
 
 
   @Override
   public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
 channel, EOModel model) throws Throwable {
   
   }
 
   @Override
   public void downgrade(EOEditingContext editingContext,  
 EOAdaptorChannel channel, EOModel model) throws Throwable {
   // TODO Auto-generated method stub
   
   } 
 }
 
 // END CLASS
 
 
 3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file
 
 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
 UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
 ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT 
 NULL;
 
 
 When I run my application never get the SQL code executed. In the 
 Application class I load a Parametros entity but I get the following error
 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression: 
 com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT 
 t0.directorio_raiz_procesamiento_cfd, t0.email_formato, 
 t0.encoding_archivo_fuente, t0.encoding_escritura_cfd, 
 t0.encoding_escritura_div_sol, t0.encoding_escritura_xml_co, 
 t0.encoding_escritura_xml_impresion, t0.encoding_lectura_jaxb, 
 t0.encoding_obtencion_co, t0.encoding_trans_co, t0.fh, t0.fhc, 
 t0.formato_fecha_dhtmlxgrid, t0.formato_numero_registro_bd, 
 t0.formato_numero_registro_bd_corto, t0.fsh, t0.fshnm, t0.iva, 
 t0.logs_debug, t0.logs_path, t0.logs_stdout, t0.metodo_impresion, 
 t0.modulo_cfdivault_habilitado, t0.moneda_id, t0.nd, t0.ne, t0.nm, 
 t0.nombre_aplicacion, t0.np, t0.ntc, t0.parametros_id, t0.retraso_daemon, 
 t0.rfc_fisica, t0.rfc_moral, t0.sistema_inicializado, t0.url_birt_viewer, 
 t0.version_comprobante FROM parametros t0 withBindings: 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  === Rollback Internal 
 Transaction
 ERROR: column t0.modulo_cfdivault_habilitado does not existat 
 

Re: Semi OT: Apache goes into frozen state

2011-04-06 Thread Johan Henselmans

On 5 apr 2011, at 02:40, Johnny Miller wrote:

 Hi,
 
 I was wondering if anyone else had experienced the same thing.  I have a 
 X-Serve running OS X 10.5.8 whose apache server is going into a frozen state 
 where it stops serving requests and can only be restarted by rebooting the 
 machine.  All other services seem to being running normally.
 
 If I look at the error_log I see many variations of this error:
 
 Too many open files in system:Some/path/on/system
 
 I've seen this thread on the Apple discussion board: 
 http://discussions.apple.com/thread.jspa?threadID=1449787start=15tstart=0
 And this article in the knowledge base: http://support.apple.com/kb/HT3512
 
 Does anyone have more wisdom to share?
 

I once had a similar problem when I started my own objectstore coordinator for 
each session, along the line of:
// this causes all kinds of mayhem: do not do this at home, it creates a new 
database connection for every session

// EOObjectStoreCoordinator coord = new EOObjectStoreCoordinator();
// myEc = ERXEC.newEditingContext(coord);
// myEc().setDelegate(this);


After that, the database would have so many open connections after a while that 
the database would have too many open files, and would break down. 

I also seem to remember that some apache configuration would freeze with a 
specific log-rotation setup. (that was apache 1.3 on a FreeBSD machine)

Furthermore I would look for something in apache that opens a file but never 
closes these. You might use opensnoop for that, see man opensnoop, or lsof 
might give you some clues. 

 Thanks in advance,
 
 Johnny Miller
 Kahalawai Media Corp
 http://www.kahalawai.com
 
 
 
 ___
 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/johan%40netsense.nl
 
 This email sent to jo...@netsense.nl

Johan Henselmans
jo...@netsense.nl





smime.p7s
Description: S/MIME cryptographic signature
 ___
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 arch...@mail-archive.com

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread John Huss
Or move your own startup code to finishInitialization() instead.

On Wed, Apr 6, 2011 at 1:07 PM, Miguel Angel Torres Avila 
mig...@toracom.net wrote:

 Thanks Chuck, Paul and Mike for your help

 The principal problem was that Migrations functionality is called
 automatically after my own code that loads some info from de data base, so
 if the migration has changes in a table that is considered in my code the
 app crashes before the migration occurs.

 The solution is to add the Chuck's code before everything else in the
 constructor of my Application class.

 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new
  ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }



 On Apr 6, 2011, at 12:51 PM, Paul D Yu wrote:

 Look at the _dbupdater table in your database.

 It should have a row in there with your EOModel name in it;  set the
 version back to null.

 Paul

 On Apr 6, 2011, at 1:43 PM, Mike Schrag wrote:

 More than likely you've already run once, and the migration did nothing, so
 it succeeded, and it's not going to run it again unless you modify the data
 in the migration version table to reset it back.

 On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote:

 Thanks Paul

 For some reason the code inside the upgrade class is never called.

 I think I should mistyped something. I am checking now.


 On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:

 Miguel

 You will need to call the external sql script from inside of your
 Migration.java file.

 @Override
 public void upgrade(EOEditingContext editingContext,
 ERXMigrationDatabase database) throws Throwable {

 ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(),
 *DInAdminEOModel1_Postgresql_Upgrade.migration*, DIModelFramework);
 }

 Something like that?

 Paul
 On Apr 6, 2011, at 1:07 PM, Chuck Hill wrote:

 Is this a full Wonder app, extending ERXApplication?  If not, you need to
 initiate the migration:

 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 
 newERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }

 Chuck


 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:

 Hi all,

 I am trying to implement Migrations in an existing Application.

 I followed the instructions in this page:


 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html

 and this one


 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html

 I think the steps are:

 *1. Modify properties file:*

 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true

 DInAdminEOModel.InitialMigrationVersion=1

 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel

 *2. Create class **com.toracom.app.migration.DInAdminEOModel1.java*
 *
 *
 /// BEGIN CLASS
 package com.toracom.app.migration;

 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;

 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;

 public class DInAdminEOModel1 extends ERXMigration {
 public NSArrayERXModelVersion modelDependencies() {
  return null;
}


 @Override
 public void upgrade(EOEditingContext editingContext, EOAdaptorChannel
 channel, EOModel model) throws Throwable {

 }

 @Override
 public void downgrade(EOEditingContext editingContext, EOAdaptorChannel
 channel, EOModel model) throws Throwable {
 // TODO Auto-generated method stub

 }
 }

 // END CLASS


 *3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file*

 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
 UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
 ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT
 NULL;


 When I run my application never get the SQL code executed. In the
 Application class I load a Parametros entity but I get the following error

 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression:
 com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT
 

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Miguel Angel Torres Avila
Thanks Chuck, Paul and Mike for your help

The principal problem was that Migrations functionality is called automatically 
after my own code that loads some info from de data base, so if the migration 
has changes in a table that is considered in my code the app crashes before the 
migration occurs.

The solution is to add the Chuck's code before everything else in the 
constructor of my Application class.

if (ERXMigrator.shouldMigrateAtStartup())
{
try
{
migrator().migrateToLatest();
}
catch (ERXMigrationFailedException e)
{
// It might be a missing plugin problem
new 
ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
throw e;
}
}



On Apr 6, 2011, at 12:51 PM, Paul D Yu wrote:

 Look at the _dbupdater table in your database.
 
 It should have a row in there with your EOModel name in it;  set the version 
 back to null.
 
 Paul
 
 On Apr 6, 2011, at 1:43 PM, Mike Schrag wrote:
 
 More than likely you've already run once, and the migration did nothing, so 
 it succeeded, and it's not going to run it again unless you modify the data 
 in the migration version table to reset it back.
 
 On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote:
 
 Thanks Paul
 
 For some reason the code inside the upgrade class is never called.
 
 I think I should mistyped something. I am checking now.
 
 
 On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:
 
 Miguel
 
 You will need to call the external sql script from inside of your 
 Migration.java file.
 
 @Override
 public void upgrade(EOEditingContext editingContext, 
 ERXMigrationDatabase database) throws Throwable {
 
 ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(),
  DInAdminEOModel1_Postgresql_Upgrade.migration, DIModelFramework);
 }
 
 Something like that?
 
 Paul
 On Apr 6, 2011, at 1:07 PM, Chuck Hill wrote:
 
 Is this a full Wonder app, extending ERXApplication?  If not, you need 
 to initiate the migration:
 
 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new 
 ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }
 
 Chuck
 
 
 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:
 
 Hi all,
 
 I am trying to implement Migrations in an existing Application.
 
 I followed the instructions in this page:
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html
 
 and this one 
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html
 
 I think the steps are:
 
 1. Modify properties file:
 
 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true
 
 DInAdminEOModel.InitialMigrationVersion=1
 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel
  
 
 2. Create class com.toracom.app.migration.DInAdminEOModel1.java
 
 /// BEGIN CLASS
 package com.toracom.app.migration;
 
 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;
 
 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;
 
 public class DInAdminEOModel1 extends ERXMigration {
  public NSArrayERXModelVersion modelDependencies() { 
   return null; 
 } 
 
 
  @Override
  public void upgrade(EOEditingContext editingContext, EOAdaptorChannel 
 channel, EOModel model) throws Throwable {
  
  }
 
  @Override
  public void downgrade(EOEditingContext editingContext,  
 EOAdaptorChannel channel, EOModel model) throws Throwable {
  // TODO Auto-generated method stub
  
  } 
 }
 
 // END CLASS
 
 
 3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file
 
 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado varchar(5);
 UDPATE parametros SET modulo_cfdivault_habilitado = 'false';
 ALTER TABLE parametros ALTER COLUMN modulo_cfdivault_habilitado SET NOT 
 NULL;
 
 
 When I run my application never get the SQL code executed. In the 
 Application class I load a Parametros entity but I get the following 
 error
 
 Apr 06 11:38:11 dinadmin[9] DEBUG NSLog  -  evaluateExpression: 
 com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT DISTINCT 
 t0.directorio_raiz_procesamiento_cfd, t0.email_formato, 
 

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Miguel Angel Torres Avila
Nope,

It did not work for me.

Same error, it looks like the Migrations functions are called after 
finishInitialization also.

Thanks for the hint.



This is the code in my Application class



On Apr 6, 2011, at 1:12 PM, John Huss wrote:

 Or move your own startup code to finishInitialization() instead.
 
 On Wed, Apr 6, 2011 at 1:07 PM, Miguel Angel Torres Avila 
 mig...@toracom.net wrote:
 Thanks Chuck, Paul and Mike for your help
 
 The principal problem was that Migrations functionality is called 
 automatically after my own code that loads some info from de data base, so if 
 the migration has changes in a table that is considered in my code the app 
 crashes before the migration occurs.
 
 The solution is to add the Chuck's code before everything else in the 
 constructor of my Application class.
 
 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new 
 ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }
 
 
 
 On Apr 6, 2011, at 12:51 PM, Paul D Yu wrote:
 
 Look at the _dbupdater table in your database.
 
 It should have a row in there with your EOModel name in it;  set the version 
 back to null.
 
 Paul
 
 On Apr 6, 2011, at 1:43 PM, Mike Schrag wrote:
 
 More than likely you've already run once, and the migration did nothing, so 
 it succeeded, and it's not going to run it again unless you modify the data 
 in the migration version table to reset it back.
 
 On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote:
 
 Thanks Paul
 
 For some reason the code inside the upgrade class is never called.
 
 I think I should mistyped something. I am checking now.
 
 
 On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:
 
 Miguel
 
 You will need to call the external sql script from inside of your 
 Migration.java file.
 
 @Override
 public void upgrade(EOEditingContext editingContext, 
 ERXMigrationDatabase database) throws Throwable {
 
 ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(),
  DInAdminEOModel1_Postgresql_Upgrade.migration, DIModelFramework);
 }
 
 Something like that?
 
 Paul
 On Apr 6, 2011, at 1:07 PM, Chuck Hill wrote:
 
 Is this a full Wonder app, extending ERXApplication?  If not, you need 
 to initiate the migration:
 
 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new 
 ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }
 
 Chuck
 
 
 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:
 
 Hi all,
 
 I am trying to implement Migrations in an existing Application.
 
 I followed the instructions in this page:
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html
 
 and this one 
 
 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html
 
 I think the steps are:
 
 1. Modify properties file:
 
 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true
 
 DInAdminEOModel.InitialMigrationVersion=1
 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel
  
 
 2. Create class com.toracom.app.migration.DInAdminEOModel1.java
 
 /// BEGIN CLASS
 package com.toracom.app.migration;
 
 import com.webobjects.eoaccess.EOAdaptorChannel;
 import com.webobjects.eoaccess.EOModel;
 import com.webobjects.eocontrol.EOEditingContext;
 import com.webobjects.foundation.NSArray;
 
 import er.extensions.migration.ERXMigration;
 import er.extensions.migration.ERXModelVersion;
 
 public class DInAdminEOModel1 extends ERXMigration {
 public NSArrayERXModelVersion modelDependencies() { 
  return null; 
} 
 
 
 @Override
 public void upgrade(EOEditingContext editingContext, 
 EOAdaptorChannel channel, EOModel model) throws Throwable {
 
 }
 
 @Override
 public void downgrade(EOEditingContext editingContext,  
 EOAdaptorChannel channel, EOModel model) throws Throwable {
 // TODO Auto-generated method stub
 
 } 
 }
 
 // END CLASS
 
 
 3. Create DInAdminEOModel1_Postgresql_Upgrade.migration file
 
 ALTER TABLE parametros ADD COLUMN modulo_cfdivault_habilitado 
 

Re: Semi OT: Apache goes into frozen state

2011-04-06 Thread Johnny Miller
Hi Johan,

Yeah, I'm not doing anything unusual like creating a DB connection per server.

If I run from the CLI:

sudo lsof | grep httpd | wc -l

The count kind of bounces up and down between 500 - 1,500

If I just look at the contents instead of the count I see a bunch of redundant 
connections to access_log and the various modules (see below)

To be honest I'm out of my element here, so I'm not sure if this is unusual or 
not.  I've updated the apache's launch daemon plist to increase the number of 
connections apache is allowed to 2048 and I've gone a couple of days without a 
failure.  But I did do an intentional restart last night.  Prior to altering 
the plist I was seeing apache going into the unresponsive state about every 24 
hours.

When I called Apple they told me to run netstat -m and look at this section:

0 requests for memory denied
0 requests for memory delayed

If that goes over 0 you can increase the memory buffer per this article: 
http://support.apple.com/kb/HT3512  But I've yet to see that number go over 
zero.

(this prints out several times)
httpd 6511   _www  txt   REG   14,21996352   17733353 
/usr/sbin/httpd
httpd 6511   _www  txt   REG   14,2 393792   17733502 
/usr/lib/libaprutil-1.0.2.7.dylib
httpd 6511   _www  txt   REG   14,2 651248  15133 
/usr/lib/libexpat.1.5.0.dylib
httpd 6511   _www  txt   REG   14,24147008  15324 
/usr/lib/libiconv.2.dylib
httpd 6511   _www  txt   REG   14,2 578656   17733501 
/usr/lib/libapr-1.0.2.7.dylib
httpd 6511   _www  txt   REG   14,2  53888   17733291 
/usr/libexec/apache2/mod_authn_file.so
httpd 6511   _www  txt   REG   14,2  66500   17733295 
/usr/libexec/apache2/mod_authz_host.so
httpd 6511   _www  txt   REG   14,2 201360   17733299 
/usr/libexec/apache2/mod_cache.so
httpd 6511   _www  txt   REG   14,2  70660   17733308 
/usr/libexec/apache2/mod_dumpio.so
httpd 6511   _www  txt   REG   14,2 126528   17733321 
/usr/libexec/apache2/mod_mem_cache.so
httpd 6511   _www  txt   REG   14,2 117296   17733307 
/usr/libexec/apache2/mod_disk_cache.so
httpd 6511   _www  txt   REG   14,2 105944   17733311 
/usr/libexec/apache2/mod_ext_filter.so
httpd 6511   _www  txt   REG   14,2 245316   17733316 
/usr/libexec/apache2/mod_include.so
httpd 6511   _www  txt   REG   14,2  91784   17733312 
/usr/libexec/apache2/mod_filter.so
httpd 6511   _www  txt   REG   14,2 121380   17733305 
/usr/libexec/apache2/mod_deflate.so
httpd 6511   _www  txt   REG   14,2 126208   17733318 
/usr/libexec/apache2/mod_log_config.so
httpd 6511   _www  txt   REG   14,2  54200   17733320 
/usr/libexec/apache2/mod_logio.so
httpd 6511   _www  txt   REG   14,2  53956   17733309 
/usr/libexec/apache2/mod_env.so
httpd 6511   _www  txt   REG   14,2  71040   17733310 
/usr/libexec/apache2/mod_expires.so
httpd 6511   _www  txt   REG   14,2 100768   17733313 
/usr/libexec/apache2/mod_headers.so
httpd 6511   _www  txt   REG   14,2  66568   17733314 
/usr/libexec/apache2/mod_ident.so
httpd 6511   _www  txt   REG   14,2  70940   1774 
/usr/libexec/apache2/mod_setenvif.so
httpd 6511   _www  txt   REG   14,2 378832   17733325 
/usr/libexec/apache2/mod_proxy.so
httpd 6511   _www  txt   REG   14,2 168484   1770 
/usr/libexec/apache2/mod_proxy_http.so
httpd 6511   _www  txt   REG   14,2 138088   17733327 
/usr/libexec/apache2/mod_proxy_balancer.so
httpd 6511   _www  txt   REG   14,2 786308   1776 
/usr/libexec/apache2/mod_ssl.so
httpd 6511   _www  txt   REG   14,2 915632   17731671 
/usr/lib/libssl.0.9.7.dylib
httpd 6511   _www  txt   REG   14,2 100588   17733322 
/usr/libexec/apache2/mod_mime.so
httpd 6511   _www  txt   REG   14,2 120612   1777 
/usr/libexec/apache2/mod_status.so
httpd 6511   _www  txt   REG   14,2 176016   17733298 
/usr/libexec/apache2/mod_autoindex.so
httpd 6511   _www  txt   REG   14,2  54000   17733284 
/usr/libexec/apache2/mod_asis.so
httpd 6511   _www  txt   REG   14,2 101080   17733317 
/usr/libexec/apache2/mod_info.so
httpd 6511   _www  txt   REG   14,2 127384   17733301 
/usr/libexec/apache2/mod_cgi.so
httpd 6511   _www  txt   REG   14,2  70560   17733343 
/usr/libexec/apache2/mod_vhost_alias.so
httpd 6511   _www  txt   REG   14,2  

Re: Semi OT: Apache goes into frozen state

2011-04-06 Thread Pascal Robert

Le 2011-04-06 à 14:38, Johnny Miller a écrit :

 Hi Johan,
 
 Yeah, I'm not doing anything unusual like creating a DB connection per server.
 
 If I run from the CLI:
 
 sudo lsof | grep httpd | wc -l
 
 The count kind of bounces up and down between 500 - 1,500
 
 If I just look at the contents instead of the count I see a bunch of 
 redundant connections to access_log and the various modules (see below)
 
 To be honest I'm out of my element here, so I'm not sure if this is unusual 
 or not.  I've updated the apache's launch daemon plist to increase the number 
 of connections apache is allowed to 2048

MaxClient and ServerLimit set to 2048??  Are you sure that you need that much 
clients? I think I never set that value pass 384.

How many httpd processes do you have? You can find out like this:

  # lsof -P | grep /usr/sbin/httpd | wc -l

 and I've gone a couple of days without a failure.  But I did do an 
 intentional restart last night.  Prior to altering the plist I was seeing 
 apache going into the unresponsive state about every 24 hours.
 
 When I called Apple they told me to run netstat -m and look at this section:
 
 0 requests for memory denied
 0 requests for memory delayed
 
 If that goes over 0 you can increase the memory buffer per this article: 
 http://support.apple.com/kb/HT3512  But I've yet to see that number go over 
 zero.
 
 (this prints out several times)
 httpd 6511   _www  txt   REG   14,21996352   17733353 
 /usr/sbin/httpd
 httpd 6511   _www  txt   REG   14,2 393792   17733502 
 /usr/lib/libaprutil-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2 651248  15133 
 /usr/lib/libexpat.1.5.0.dylib
 httpd 6511   _www  txt   REG   14,24147008  15324 
 /usr/lib/libiconv.2.dylib
 httpd 6511   _www  txt   REG   14,2 578656   17733501 
 /usr/lib/libapr-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2  53888   17733291 
 /usr/libexec/apache2/mod_authn_file.so
 httpd 6511   _www  txt   REG   14,2  66500   17733295 
 /usr/libexec/apache2/mod_authz_host.so
 httpd 6511   _www  txt   REG   14,2 201360   17733299 
 /usr/libexec/apache2/mod_cache.so
 httpd 6511   _www  txt   REG   14,2  70660   17733308 
 /usr/libexec/apache2/mod_dumpio.so
 httpd 6511   _www  txt   REG   14,2 126528   17733321 
 /usr/libexec/apache2/mod_mem_cache.so
 httpd 6511   _www  txt   REG   14,2 117296   17733307 
 /usr/libexec/apache2/mod_disk_cache.so
 httpd 6511   _www  txt   REG   14,2 105944   17733311 
 /usr/libexec/apache2/mod_ext_filter.so
 httpd 6511   _www  txt   REG   14,2 245316   17733316 
 /usr/libexec/apache2/mod_include.so
 httpd 6511   _www  txt   REG   14,2  91784   17733312 
 /usr/libexec/apache2/mod_filter.so
 httpd 6511   _www  txt   REG   14,2 121380   17733305 
 /usr/libexec/apache2/mod_deflate.so
 httpd 6511   _www  txt   REG   14,2 126208   17733318 
 /usr/libexec/apache2/mod_log_config.so
 httpd 6511   _www  txt   REG   14,2  54200   17733320 
 /usr/libexec/apache2/mod_logio.so
 httpd 6511   _www  txt   REG   14,2  53956   17733309 
 /usr/libexec/apache2/mod_env.so
 httpd 6511   _www  txt   REG   14,2  71040   17733310 
 /usr/libexec/apache2/mod_expires.so
 httpd 6511   _www  txt   REG   14,2 100768   17733313 
 /usr/libexec/apache2/mod_headers.so
 httpd 6511   _www  txt   REG   14,2  66568   17733314 
 /usr/libexec/apache2/mod_ident.so
 httpd 6511   _www  txt   REG   14,2  70940   1774 
 /usr/libexec/apache2/mod_setenvif.so
 httpd 6511   _www  txt   REG   14,2 378832   17733325 
 /usr/libexec/apache2/mod_proxy.so
 httpd 6511   _www  txt   REG   14,2 168484   1770 
 /usr/libexec/apache2/mod_proxy_http.so
 httpd 6511   _www  txt   REG   14,2 138088   17733327 
 /usr/libexec/apache2/mod_proxy_balancer.so
 httpd 6511   _www  txt   REG   14,2 786308   1776 
 /usr/libexec/apache2/mod_ssl.so
 httpd 6511   _www  txt   REG   14,2 915632   17731671 
 /usr/lib/libssl.0.9.7.dylib
 httpd 6511   _www  txt   REG   14,2 100588   17733322 
 /usr/libexec/apache2/mod_mime.so
 httpd 6511   _www  txt   REG   14,2 120612   1777 
 /usr/libexec/apache2/mod_status.so
 httpd 6511   _www  txt   REG   14,2 176016   17733298 
 /usr/libexec/apache2/mod_autoindex.so
 httpd 6511   _www  txt   REG   14,2  54000   17733284 
 /usr/libexec/apache2/mod_asis.so
 httpd 6511  

Re: Semi OT: Apache goes into frozen state

2011-04-06 Thread Chuck Hill

On Apr 6, 2011, at 11:54 AM, Pascal Robert wrote:

 
 Le 2011-04-06 à 14:38, Johnny Miller a écrit :
 
 Hi Johan,
 
 Yeah, I'm not doing anything unusual like creating a DB connection per 
 server.
 
 If I run from the CLI:
 
 sudo lsof | grep httpd | wc -l
 
 The count kind of bounces up and down between 500 - 1,500

I just got 7652 on a deployed that I would consider small.


 If I just look at the contents instead of the count I see a bunch of 
 redundant connections to access_log and the various modules (see below)
 
 To be honest I'm out of my element here, so I'm not sure if this is unusual 
 or not.  I've updated the apache's launch daemon plist to increase the 
 number of connections apache is allowed to 2048
 
 MaxClient and ServerLimit set to 2048??  Are you sure that you need that much 
 clients? I think I never set that value pass 384.

Yeah, that seems wy excessive.


 
 How many httpd processes do you have? You can find out like this:
 
   # lsof -P | grep /usr/sbin/httpd | wc -l

That gives me 0 on OS X, this works for me:

ps auxwww | grep httpd | wc -l


Chuck

 and I've gone a couple of days without a failure.  But I did do an 
 intentional restart last night.  Prior to altering the plist I was seeing 
 apache going into the unresponsive state about every 24 hours.
 
 When I called Apple they told me to run netstat -m and look at this section:
 
 0 requests for memory denied
 0 requests for memory delayed
 
 If that goes over 0 you can increase the memory buffer per this article: 
 http://support.apple.com/kb/HT3512  But I've yet to see that number go over 
 zero.
 
 (this prints out several times)
 httpd 6511   _www  txt   REG   14,21996352   
 17733353 /usr/sbin/httpd
 httpd 6511   _www  txt   REG   14,2 393792   
 17733502 /usr/lib/libaprutil-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2 651248  
 15133 /usr/lib/libexpat.1.5.0.dylib
 httpd 6511   _www  txt   REG   14,24147008  
 15324 /usr/lib/libiconv.2.dylib
 httpd 6511   _www  txt   REG   14,2 578656   
 17733501 /usr/lib/libapr-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2  53888   
 17733291 /usr/libexec/apache2/mod_authn_file.so
 httpd 6511   _www  txt   REG   14,2  66500   
 17733295 /usr/libexec/apache2/mod_authz_host.so
 httpd 6511   _www  txt   REG   14,2 201360   
 17733299 /usr/libexec/apache2/mod_cache.so
 httpd 6511   _www  txt   REG   14,2  70660   
 17733308 /usr/libexec/apache2/mod_dumpio.so
 httpd 6511   _www  txt   REG   14,2 126528   
 17733321 /usr/libexec/apache2/mod_mem_cache.so
 httpd 6511   _www  txt   REG   14,2 117296   
 17733307 /usr/libexec/apache2/mod_disk_cache.so
 httpd 6511   _www  txt   REG   14,2 105944   
 17733311 /usr/libexec/apache2/mod_ext_filter.so
 httpd 6511   _www  txt   REG   14,2 245316   
 17733316 /usr/libexec/apache2/mod_include.so
 httpd 6511   _www  txt   REG   14,2  91784   
 17733312 /usr/libexec/apache2/mod_filter.so
 httpd 6511   _www  txt   REG   14,2 121380   
 17733305 /usr/libexec/apache2/mod_deflate.so
 httpd 6511   _www  txt   REG   14,2 126208   
 17733318 /usr/libexec/apache2/mod_log_config.so
 httpd 6511   _www  txt   REG   14,2  54200   
 17733320 /usr/libexec/apache2/mod_logio.so
 httpd 6511   _www  txt   REG   14,2  53956   
 17733309 /usr/libexec/apache2/mod_env.so
 httpd 6511   _www  txt   REG   14,2  71040   
 17733310 /usr/libexec/apache2/mod_expires.so
 httpd 6511   _www  txt   REG   14,2 100768   
 17733313 /usr/libexec/apache2/mod_headers.so
 httpd 6511   _www  txt   REG   14,2  66568   
 17733314 /usr/libexec/apache2/mod_ident.so
 httpd 6511   _www  txt   REG   14,2  70940   
 1774 /usr/libexec/apache2/mod_setenvif.so
 httpd 6511   _www  txt   REG   14,2 378832   
 17733325 /usr/libexec/apache2/mod_proxy.so
 httpd 6511   _www  txt   REG   14,2 168484   
 1770 /usr/libexec/apache2/mod_proxy_http.so
 httpd 6511   _www  txt   REG   14,2 138088   
 17733327 /usr/libexec/apache2/mod_proxy_balancer.so
 httpd 6511   _www  txt   REG   14,2 786308   
 1776 /usr/libexec/apache2/mod_ssl.so
 httpd 6511   _www  txt   REG   14,2 915632   
 17731671 /usr/lib/libssl.0.9.7.dylib
 httpd 6511   _www  txt   REG   14,2 100588   
 17733322 /usr/libexec/apache2/mod_mime.so
 httpd 6511   _www  txt   REG   14,2 120612   
 1777 /usr/libexec/apache2/mod_status.so
 

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread John Huss
But when didFinishLaunching happens the app is already accepting requests
(if concurrent handling is turned on), isn't it?  I thought so; if so,
that's not a good place to do something that your app requires to run
correctly.

John

On Wed, Apr 6, 2011 at 2:02 PM, Miguel Angel Torres Avila 
mig...@toracom.net wrote:

 Thanks Chuck, I implemented the third option and worked like a charm!


 On Apr 6, 2011, at 1:46 PM, Chuck Hill wrote:

 I will suggest not doing that in a Wonder app.  :-)  I think you should
 move the code.  There are a few choices:

 1. Use this notification:
   /**
* Notification to post when all application initialization processes
 are complete (including migrations)
*/
   public static final String
 ApplicationDidFinishInitializationNotification =
 NSApplicationDidFinishInitializationNotification;


 2. Use this method:
 /**
  * Called after migrations finish running.
  * @param migrator the migrator that was used
  */
 protected void migrationsDidRun(ERXMigrator migrator) {
 // DO NOTHING
 }

 3. Use this method:
 /**
  * Called when the application posts
  * {@link WOApplication#ApplicationDidFinishLaunchingNotification}.
  * Override this to perform application specific tasks after the
 application
  * has been initialized. THis is a good spot to perform batch application
  * tasks.
  */
 public void didFinishLaunching() {
 }

 Chuck


 On Apr 6, 2011, at 11:07 AM, Miguel Angel Torres Avila wrote:

 Thanks Chuck, Paul and Mike for your help

 The principal problem was that Migrations functionality is called
 automatically after my own code that loads some info from de data base, so
 if the migration has changes in a table that is considered in my code the
 app crashes before the migration occurs.

 The solution is to add the Chuck's code before everything else in the
 constructor of my Application class.

 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 new
  ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }



 On Apr 6, 2011, at 12:51 PM, Paul D Yu wrote:

 Look at the _dbupdater table in your database.

 It should have a row in there with your EOModel name in it;  set the
 version back to null.

 Paul

 On Apr 6, 2011, at 1:43 PM, Mike Schrag wrote:

 More than likely you've already run once, and the migration did nothing, so
 it succeeded, and it's not going to run it again unless you modify the data
 in the migration version table to reset it back.

 On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote:

 Thanks Paul

 For some reason the code inside the upgrade class is never called.

 I think I should mistyped something. I am checking now.


 On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:

 Miguel

 You will need to call the external sql script from inside of your
 Migration.java file.

 @Override
 public void upgrade(EOEditingContext editingContext,
 ERXMigrationDatabase database) throws Throwable {

 ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(),
 *DInAdminEOModel1_Postgresql_Upgrade.migration*, DIModelFramework);
 }

 Something like that?

 Paul
 On Apr 6, 2011, at 1:07 PM, Chuck Hill wrote:

 Is this a full Wonder app, extending ERXApplication?  If not, you need to
 initiate the migration:

 if (ERXMigrator.shouldMigrateAtStartup())
 {
 try
 {
 migrator().migrateToLatest();
 }
 catch (ERXMigrationFailedException e)
 {
 // It might be a missing plugin problem
 
 newERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
 throw e;
 }
 }

 Chuck


 On Apr 6, 2011, at 9:47 AM, Miguel Angel Torres Avila wrote:

 Hi all,

 I am trying to implement Migrations in an existing Application.

 I followed the instructions in this page:


 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html

 and this one


 http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/ERXMigration.html

 I think the steps are:

 *1. Modify properties file:*

 # Migrations
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=DInAdminEOModel
 er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true

 DInAdminEOModel.InitialMigrationVersion=1

 DInAdminEOModel.MigrationClassPrefix=com.toracom.app.migration.DInAdminEOModel

 *2. Create class **com.toracom.app.migration.DInAdminEOModel1.java*
 *
 *
 /// BEGIN CLASS
 package com.toracom.app.migration;

 

Re: Semi OT: Apache goes into frozen state

2011-04-06 Thread Johnny Miller
Mssr. Robert,

Thank you for the suggestion.  If I run the command you suggested I get a 
fluctuating count between 3 and 9.  While that is way below the threshold you 
suggested I'm not sure I'm convinced that is the whole story.  Otherwise why 
would I be having a problem?

Best,

Johnny

On Apr 6, 2011, at 8:54 AM, Pascal Robert wrote:

 
 Le 2011-04-06 à 14:38, Johnny Miller a écrit :
 
 Hi Johan,
 
 Yeah, I'm not doing anything unusual like creating a DB connection per 
 server.
 
 If I run from the CLI:
 
 sudo lsof | grep httpd | wc -l
 
 The count kind of bounces up and down between 500 - 1,500
 
 If I just look at the contents instead of the count I see a bunch of 
 redundant connections to access_log and the various modules (see below)
 
 To be honest I'm out of my element here, so I'm not sure if this is unusual 
 or not.  I've updated the apache's launch daemon plist to increase the 
 number of connections apache is allowed to 2048
 
 MaxClient and ServerLimit set to 2048??  Are you sure that you need that much 
 clients? I think I never set that value pass 384.
 
 How many httpd processes do you have? You can find out like this:
 
   # lsof -P | grep /usr/sbin/httpd | wc -l
 
 and I've gone a couple of days without a failure.  But I did do an 
 intentional restart last night.  Prior to altering the plist I was seeing 
 apache going into the unresponsive state about every 24 hours.
 
 When I called Apple they told me to run netstat -m and look at this section:
 
 0 requests for memory denied
 0 requests for memory delayed
 
 If that goes over 0 you can increase the memory buffer per this article: 
 http://support.apple.com/kb/HT3512  But I've yet to see that number go over 
 zero.
 
 (this prints out several times)
 httpd 6511   _www  txt   REG   14,21996352   
 17733353 /usr/sbin/httpd
 httpd 6511   _www  txt   REG   14,2 393792   
 17733502 /usr/lib/libaprutil-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2 651248  
 15133 /usr/lib/libexpat.1.5.0.dylib
 httpd 6511   _www  txt   REG   14,24147008  
 15324 /usr/lib/libiconv.2.dylib
 httpd 6511   _www  txt   REG   14,2 578656   
 17733501 /usr/lib/libapr-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2  53888   
 17733291 /usr/libexec/apache2/mod_authn_file.so
 httpd 6511   _www  txt   REG   14,2  66500   
 17733295 /usr/libexec/apache2/mod_authz_host.so
 httpd 6511   _www  txt   REG   14,2 201360   
 17733299 /usr/libexec/apache2/mod_cache.so
 httpd 6511   _www  txt   REG   14,2  70660   
 17733308 /usr/libexec/apache2/mod_dumpio.so
 httpd 6511   _www  txt   REG   14,2 126528   
 17733321 /usr/libexec/apache2/mod_mem_cache.so
 httpd 6511   _www  txt   REG   14,2 117296   
 17733307 /usr/libexec/apache2/mod_disk_cache.so
 httpd 6511   _www  txt   REG   14,2 105944   
 17733311 /usr/libexec/apache2/mod_ext_filter.so
 httpd 6511   _www  txt   REG   14,2 245316   
 17733316 /usr/libexec/apache2/mod_include.so
 httpd 6511   _www  txt   REG   14,2  91784   
 17733312 /usr/libexec/apache2/mod_filter.so
 httpd 6511   _www  txt   REG   14,2 121380   
 17733305 /usr/libexec/apache2/mod_deflate.so
 httpd 6511   _www  txt   REG   14,2 126208   
 17733318 /usr/libexec/apache2/mod_log_config.so
 httpd 6511   _www  txt   REG   14,2  54200   
 17733320 /usr/libexec/apache2/mod_logio.so
 httpd 6511   _www  txt   REG   14,2  53956   
 17733309 /usr/libexec/apache2/mod_env.so
 httpd 6511   _www  txt   REG   14,2  71040   
 17733310 /usr/libexec/apache2/mod_expires.so
 httpd 6511   _www  txt   REG   14,2 100768   
 17733313 /usr/libexec/apache2/mod_headers.so
 httpd 6511   _www  txt   REG   14,2  66568   
 17733314 /usr/libexec/apache2/mod_ident.so
 httpd 6511   _www  txt   REG   14,2  70940   
 1774 /usr/libexec/apache2/mod_setenvif.so
 httpd 6511   _www  txt   REG   14,2 378832   
 17733325 /usr/libexec/apache2/mod_proxy.so
 httpd 6511   _www  txt   REG   14,2 168484   
 1770 /usr/libexec/apache2/mod_proxy_http.so
 httpd 6511   _www  txt   REG   14,2 138088   
 17733327 /usr/libexec/apache2/mod_proxy_balancer.so
 httpd 6511   _www  txt   REG   14,2 786308   
 1776 /usr/libexec/apache2/mod_ssl.so
 httpd 6511   _www  txt   REG   14,2 915632   
 17731671 /usr/lib/libssl.0.9.7.dylib
 httpd 6511   _www  txt   REG   14,2 100588   
 17733322 /usr/libexec/apache2/mod_mime.so
 httpd 

Re: Semi OT: Apache goes into frozen state

2011-04-06 Thread Chuck Hill
You are confusing number of Apache processes with file handles/sockets.  The 
error message
 Too many open files in system:Some/path/on/system
refers to the latter, the number of connections is the former.


Chuck


On Apr 6, 2011, at 12:10 PM, Johnny Miller wrote:

 Mssr. Robert,
 
 Thank you for the suggestion.  If I run the command you suggested I get a 
 fluctuating count between 3 and 9.  While that is way below the threshold you 
 suggested I'm not sure I'm convinced that is the whole story.  Otherwise why 
 would I be having a problem?
 
 Best,
 
 Johnny
 
 On Apr 6, 2011, at 8:54 AM, Pascal Robert wrote:
 
 
 Le 2011-04-06 à 14:38, Johnny Miller a écrit :
 
 Hi Johan,
 
 Yeah, I'm not doing anything unusual like creating a DB connection per 
 server.
 
 If I run from the CLI:
 
 sudo lsof | grep httpd | wc -l
 
 The count kind of bounces up and down between 500 - 1,500
 
 If I just look at the contents instead of the count I see a bunch of 
 redundant connections to access_log and the various modules (see below)
 
 To be honest I'm out of my element here, so I'm not sure if this is unusual 
 or not.  I've updated the apache's launch daemon plist to increase the 
 number of connections apache is allowed to 2048
 
 MaxClient and ServerLimit set to 2048??  Are you sure that you need that 
 much clients? I think I never set that value pass 384.
 
 How many httpd processes do you have? You can find out like this:
 
   # lsof -P | grep /usr/sbin/httpd | wc -l
 
 and I've gone a couple of days without a failure.  But I did do an 
 intentional restart last night.  Prior to altering the plist I was seeing 
 apache going into the unresponsive state about every 24 hours.
 
 When I called Apple they told me to run netstat -m and look at this section:
 
 0 requests for memory denied
 0 requests for memory delayed
 
 If that goes over 0 you can increase the memory buffer per this article: 
 http://support.apple.com/kb/HT3512  But I've yet to see that number go over 
 zero.
 
 (this prints out several times)
 httpd 6511   _www  txt   REG   14,21996352   
 17733353 /usr/sbin/httpd
 httpd 6511   _www  txt   REG   14,2 393792   
 17733502 /usr/lib/libaprutil-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2 651248  
 15133 /usr/lib/libexpat.1.5.0.dylib
 httpd 6511   _www  txt   REG   14,24147008  
 15324 /usr/lib/libiconv.2.dylib
 httpd 6511   _www  txt   REG   14,2 578656   
 17733501 /usr/lib/libapr-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2  53888   
 17733291 /usr/libexec/apache2/mod_authn_file.so
 httpd 6511   _www  txt   REG   14,2  66500   
 17733295 /usr/libexec/apache2/mod_authz_host.so
 httpd 6511   _www  txt   REG   14,2 201360   
 17733299 /usr/libexec/apache2/mod_cache.so
 httpd 6511   _www  txt   REG   14,2  70660   
 17733308 /usr/libexec/apache2/mod_dumpio.so
 httpd 6511   _www  txt   REG   14,2 126528   
 17733321 /usr/libexec/apache2/mod_mem_cache.so
 httpd 6511   _www  txt   REG   14,2 117296   
 17733307 /usr/libexec/apache2/mod_disk_cache.so
 httpd 6511   _www  txt   REG   14,2 105944   
 17733311 /usr/libexec/apache2/mod_ext_filter.so
 httpd 6511   _www  txt   REG   14,2 245316   
 17733316 /usr/libexec/apache2/mod_include.so
 httpd 6511   _www  txt   REG   14,2  91784   
 17733312 /usr/libexec/apache2/mod_filter.so
 httpd 6511   _www  txt   REG   14,2 121380   
 17733305 /usr/libexec/apache2/mod_deflate.so
 httpd 6511   _www  txt   REG   14,2 126208   
 17733318 /usr/libexec/apache2/mod_log_config.so
 httpd 6511   _www  txt   REG   14,2  54200   
 17733320 /usr/libexec/apache2/mod_logio.so
 httpd 6511   _www  txt   REG   14,2  53956   
 17733309 /usr/libexec/apache2/mod_env.so
 httpd 6511   _www  txt   REG   14,2  71040   
 17733310 /usr/libexec/apache2/mod_expires.so
 httpd 6511   _www  txt   REG   14,2 100768   
 17733313 /usr/libexec/apache2/mod_headers.so
 httpd 6511   _www  txt   REG   14,2  66568   
 17733314 /usr/libexec/apache2/mod_ident.so
 httpd 6511   _www  txt   REG   14,2  70940   
 1774 /usr/libexec/apache2/mod_setenvif.so
 httpd 6511   _www  txt   REG   14,2 378832   
 17733325 /usr/libexec/apache2/mod_proxy.so
 httpd 6511   _www  txt   REG   14,2 168484   
 1770 /usr/libexec/apache2/mod_proxy_http.so
 httpd 6511   _www  txt   REG   14,2 138088   
 17733327 /usr/libexec/apache2/mod_proxy_balancer.so
 httpd 6511   _www  txt   REG   14,2 

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Mike Schrag
 I am not sure why finishInitialization() is called before migrating:
I think because when I wrote migrations, I was using that method for something 
that had to run before migrations :) When you write migrations, you can put it 
before ;)

 It would be a good place to to do post-migration work if it was called after. 
  Mike, why is this before?  Or, one could implement didFinishInitialization 
 in Wonder, triggered by that notification.
Yes .. There SHOULD be a didFinishInitialization call at the end of that 
method. It would make it a lot easier to use. You don't have to even attach it 
to the notification, just call it right after that notification dispatch.

ms ___
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 arch...@mail-archive.com

Re: Semi OT: Apache goes into frozen state

2011-04-06 Thread Pascal Robert

Le 2011-04-06 à 15:26, Chuck Hill a écrit :

 You are confusing number of Apache processes with file handles/sockets.  The 
 error message
 Too many open files in system:Some/path/on/system
 refers to the latter, the number of connections is the former.

And using lsof on Some/path/on/system will tell which processes are holding 
files on that directory. Example:

# sudo lsof -P +D /private/tmp/

Will find all files opened in /private/tmp

 
 Chuck
 
 
 On Apr 6, 2011, at 12:10 PM, Johnny Miller wrote:
 
 Mssr. Robert,
 
 Thank you for the suggestion.  If I run the command you suggested I get a 
 fluctuating count between 3 and 9.  While that is way below the threshold 
 you suggested I'm not sure I'm convinced that is the whole story.  Otherwise 
 why would I be having a problem?
 
 Best,
 
 Johnny
 
 On Apr 6, 2011, at 8:54 AM, Pascal Robert wrote:
 
 
 Le 2011-04-06 à 14:38, Johnny Miller a écrit :
 
 Hi Johan,
 
 Yeah, I'm not doing anything unusual like creating a DB connection per 
 server.
 
 If I run from the CLI:
 
 sudo lsof | grep httpd | wc -l
 
 The count kind of bounces up and down between 500 - 1,500
 
 If I just look at the contents instead of the count I see a bunch of 
 redundant connections to access_log and the various modules (see below)
 
 To be honest I'm out of my element here, so I'm not sure if this is 
 unusual or not.  I've updated the apache's launch daemon plist to increase 
 the number of connections apache is allowed to 2048
 
 MaxClient and ServerLimit set to 2048??  Are you sure that you need that 
 much clients? I think I never set that value pass 384.
 
 How many httpd processes do you have? You can find out like this:
 
   # lsof -P | grep /usr/sbin/httpd | wc -l
 
 and I've gone a couple of days without a failure.  But I did do an 
 intentional restart last night.  Prior to altering the plist I was seeing 
 apache going into the unresponsive state about every 24 hours.
 
 When I called Apple they told me to run netstat -m and look at this 
 section:
 
 0 requests for memory denied
 0 requests for memory delayed
 
 If that goes over 0 you can increase the memory buffer per this article: 
 http://support.apple.com/kb/HT3512  But I've yet to see that number go 
 over zero.
 
 (this prints out several times)
 httpd 6511   _www  txt   REG   14,21996352   
 17733353 /usr/sbin/httpd
 httpd 6511   _www  txt   REG   14,2 393792   
 17733502 /usr/lib/libaprutil-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2 651248  
 15133 /usr/lib/libexpat.1.5.0.dylib
 httpd 6511   _www  txt   REG   14,24147008  
 15324 /usr/lib/libiconv.2.dylib
 httpd 6511   _www  txt   REG   14,2 578656   
 17733501 /usr/lib/libapr-1.0.2.7.dylib
 httpd 6511   _www  txt   REG   14,2  53888   
 17733291 /usr/libexec/apache2/mod_authn_file.so
 httpd 6511   _www  txt   REG   14,2  66500   
 17733295 /usr/libexec/apache2/mod_authz_host.so
 httpd 6511   _www  txt   REG   14,2 201360   
 17733299 /usr/libexec/apache2/mod_cache.so
 httpd 6511   _www  txt   REG   14,2  70660   
 17733308 /usr/libexec/apache2/mod_dumpio.so
 httpd 6511   _www  txt   REG   14,2 126528   
 17733321 /usr/libexec/apache2/mod_mem_cache.so
 httpd 6511   _www  txt   REG   14,2 117296   
 17733307 /usr/libexec/apache2/mod_disk_cache.so
 httpd 6511   _www  txt   REG   14,2 105944   
 17733311 /usr/libexec/apache2/mod_ext_filter.so
 httpd 6511   _www  txt   REG   14,2 245316   
 17733316 /usr/libexec/apache2/mod_include.so
 httpd 6511   _www  txt   REG   14,2  91784   
 17733312 /usr/libexec/apache2/mod_filter.so
 httpd 6511   _www  txt   REG   14,2 121380   
 17733305 /usr/libexec/apache2/mod_deflate.so
 httpd 6511   _www  txt   REG   14,2 126208   
 17733318 /usr/libexec/apache2/mod_log_config.so
 httpd 6511   _www  txt   REG   14,2  54200   
 17733320 /usr/libexec/apache2/mod_logio.so
 httpd 6511   _www  txt   REG   14,2  53956   
 17733309 /usr/libexec/apache2/mod_env.so
 httpd 6511   _www  txt   REG   14,2  71040   
 17733310 /usr/libexec/apache2/mod_expires.so
 httpd 6511   _www  txt   REG   14,2 100768   
 17733313 /usr/libexec/apache2/mod_headers.so
 httpd 6511   _www  txt   REG   14,2  66568   
 17733314 /usr/libexec/apache2/mod_ident.so
 httpd 6511   _www  txt   REG   14,2  70940   
 1774 /usr/libexec/apache2/mod_setenvif.so
 httpd 6511   _www  txt   REG   14,2 378832   
 17733325 /usr/libexec/apache2/mod_proxy.so
 httpd 6511   _www  txt   REG   14,2 

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Jon Nolan

This is a bit of an aside probably not relevant to most but be warned that 
ApplicationDidFinishLaunchingNotification does not fire under servlet 
deployment.

On 4/6/11 3:37 PM, Amedeo Mantica wrote:

Hi Miguel,

you are having the same trouble I had some time ago.
i solved using an NSNotification ApplicationDidFinishLaunchingNotification as 
Chuck is suggesting you.

take a look at ERXSelectorUtilities.notificationSelector that is more easier to 
use then NSSelector.

Regards
Amedeo

You have the trouble in a framework or in the app ?


On 06/apr/2011, at 23.03, Miguel Angel Torres Avila wrote:


Thanks Chuck,

I will search for more info to learn how useful can be the notifications.

This is new to me.



On Apr 6, 2011, at 2:34 PM, Chuck Hill wrote:


Time to learn!  :-)

Add this to your app:

public final void didFinishInitialization(NSNotification n) {
// Your code here!
}

And in your constructor add:
NSNotificationCenter.defaultCenter().addObserver(this, new 
NSSelector(didFinishInitialization, ERXConstant.NotificationClassArray), 
ApplicationDidFinishInitializationNotification, null);


Chuck


On Apr 6, 2011, at 12:30 PM, Miguel Angel Torres Avila wrote:


Thanks

I changed to option 2 because I am not sure how option 1 works :P.



On Apr 6, 2011, at 2:21 PM, Mike Schrag wrote:


I highly recommend option 1 or 2 ... The exact timing of migrations was chosen 
with some care. Moving it around is probably a path to sadness.

On Apr 6, 2011, at 3:10 PM, John Huss wrote:


But when didFinishLaunching happens the app is already accepting requests (if 
concurrent handling is turned on), isn't it?  I thought so; if so, that's not a 
good place to do something that your app requires to run correctly.

John

On Wed, Apr 6, 2011 at 2:02 PM, Miguel Angel Torres Avila mig...@toracom.net 
mailto:mig...@toracom.net wrote:

Thanks Chuck, I implemented the third option and worked like a charm!


On Apr 6, 2011, at 1:46 PM, Chuck Hill wrote:


I will suggest not doing that in a Wonder app.  :-)  I think you should 
move the code.  There are a few choices:

1. Use this notification:
/**

*Notificationtopostwhenallapplicationinitializationprocessesarecomplete(includingmigrations)
*/
publicstaticfinalString ApplicationDidFinishInitializationNotification= 
NSApplicationDidFinishInitializationNotification;


2. Use this method:
/**
*Calledaftermigrationsfinishrunning.
*@parammigratorthemigratorthatwasused
*/
protected void migrationsDidRun(ERXMigrator migrator) {
// DO NOTHING
}

3. Use this method:
/**
*Calledwhentheapplicationposts
*{@link WOApplication#ApplicationDidFinishLaunchingNotification}.
*Overridethistoperformapplicationspecifictasksaftertheapplication
*hasbeeninitialized.THisisagoodspottoperformbatchapplication
*tasks.
*/
public void didFinishLaunching() {
}

Chuck


On Apr 6, 2011, at 11:07 AM, Miguel Angel Torres Avila wrote:


Thanks Chuck, Paul and Mike for your help

The principal problem was that Migrations functionality is called 
automatically after my own code that loads some info from de data base, so if 
the migration has changes in a table that is considered in my code the app 
crashes before the migration occurs.

The solution is to add the Chuck's code before everything else in the 
constructor of my Application class.

if (ERXMigrator.shouldMigrateAtStartup())
{
try
{
migrator().migrateToLatest();
}
catch (ERXMigrationFailedException e)
{
// It might be a missing plugin problem
new ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
throw e;
}
}



On Apr 6, 2011, at 12:51 PM, Paul D Yu wrote:


Look at the _dbupdater table in your database.

It should have a row in there with your EOModel name in it;  set the 
version back to null.

Paul

On Apr 6, 2011, at 1:43 PM, Mike Schrag wrote:


More than likely you've already run once, and the migration did nothing, so 
it succeeded, and it's not going to run it again unless you modify the data in 
the migration version table to reset it back.

On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote:


Thanks Paul

For some reason the code inside the upgrade class is never called.

I think I should mistyped something. I am checking now.


On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:


Miguel

You will need to call the external sql script from inside of your 
Migration.java file.

@Override
public void upgrade(EOEditingContext editingContext, ERXMigrationDatabase 
database) throws Throwable {
ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(), 
*DInAdminEOModel1_Postgresql_Upgrade.migration*, DIModelFramework);
}

Something like that?

Paul
 

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Chuck Hill
Another good reason to choose #1!


On Apr 6, 2011, at 2:41 PM, Jon Nolan wrote:

 This is a bit of an aside probably not relevant to most but be warned that 
 ApplicationDidFinishLaunchingNotification does not fire under servlet 
 deployment.
 
 On 4/6/11 3:37 PM, Amedeo Mantica wrote:
 Hi Miguel,
 
 you are having the same trouble I had some time ago.
 i solved using an NSNotification ApplicationDidFinishLaunchingNotification 
 as Chuck is suggesting you.
 
 take a look at ERXSelectorUtilities.notificationSelector that is more easier 
 to use then NSSelector.
 
 Regards
 Amedeo
 
 You have the trouble in a framework or in the app ?
 
 
 On 06/apr/2011, at 23.03, Miguel Angel Torres Avila wrote:
 
 Thanks Chuck,
 
 I will search for more info to learn how useful can be the notifications.
 
 This is new to me.
 
 
 
 On Apr 6, 2011, at 2:34 PM, Chuck Hill wrote:
 
 Time to learn!  :-)
 
 Add this to your app:
 
 public final void didFinishInitialization(NSNotification n) {
 // Your code here!
 }
 
 And in your constructor add:
 NSNotificationCenter.defaultCenter().addObserver(this, new 
 NSSelector(didFinishInitialization, ERXConstant.NotificationClassArray), 
 ApplicationDidFinishInitializationNotification, null);
 
 
 Chuck
 
 
 On Apr 6, 2011, at 12:30 PM, Miguel Angel Torres Avila wrote:
 
 Thanks
 
 I changed to option 2 because I am not sure how option 1 works :P.
 
 
 
 On Apr 6, 2011, at 2:21 PM, Mike Schrag wrote:
 
 I highly recommend option 1 or 2 ... The exact timing of migrations was 
 chosen with some care. Moving it around is probably a path to sadness.
 
 On Apr 6, 2011, at 3:10 PM, John Huss wrote:
 
 But when didFinishLaunching happens the app is already accepting 
 requests (if concurrent handling is turned on), isn't it?  I thought 
 so; if so, that's not a good place to do something that your app 
 requires to run correctly.
 
 John
 
 On Wed, Apr 6, 2011 at 2:02 PM, Miguel Angel Torres Avila 
 mig...@toracom.net mailto:mig...@toracom.net wrote:
 
Thanks Chuck, I implemented the third option and worked like a charm!
 
 
On Apr 6, 2011, at 1:46 PM, Chuck Hill wrote:
 
I will suggest not doing that in a Wonder app.  :-)  I think you 
 should move the code.  There are a few choices:
 
1. Use this notification:
/**

 *Notificationtopostwhenallapplicationinitializationprocessesarecomplete(includingmigrations)
*/
publicstaticfinalString 
 ApplicationDidFinishInitializationNotification= 
 NSApplicationDidFinishInitializationNotification;
 
 
2. Use this method:
/**
*Calledaftermigrationsfinishrunning.
*@parammigratorthemigratorthatwasused
*/
protected void migrationsDidRun(ERXMigrator migrator) {
// DO NOTHING
}
 
3. Use this method:
/**
*Calledwhentheapplicationposts
*{@link WOApplication#ApplicationDidFinishLaunchingNotification}.
*Overridethistoperformapplicationspecifictasksaftertheapplication
*hasbeeninitialized.THisisagoodspottoperformbatchapplication
*tasks.
*/
public void didFinishLaunching() {
}
 
Chuck
 
 
On Apr 6, 2011, at 11:07 AM, Miguel Angel Torres Avila wrote:
 
Thanks Chuck, Paul and Mike for your help
 
The principal problem was that Migrations functionality is called 
 automatically after my own code that loads some info from de data 
 base, so if the migration has changes in a table that is considered 
 in my code the app crashes before the migration occurs.
 
The solution is to add the Chuck's code before everything else in 
 the constructor of my Application class.
 
if (ERXMigrator.shouldMigrateAtStartup())
{
try
{
migrator().migrateToLatest();
}
catch (ERXMigrationFailedException e)
{
// It might be a missing plugin problem
new ERXJDBCConnectionAnalyzer(databaseConnectionDictionary());
throw e;
}
}
 
 
 
On Apr 6, 2011, at 12:51 PM, Paul D Yu wrote:
 
Look at the _dbupdater table in your database.
 
It should have a row in there with your EOModel name in it;  set 
 the version back to null.
 
Paul
 
On Apr 6, 2011, at 1:43 PM, Mike Schrag wrote:
 
More than likely you've already run once, and the migration did 
 nothing, so it succeeded, and it's not going to run it again unless 
 you modify the data in the migration version table to reset it back.
 
On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote:
 
Thanks Paul
 
For some reason the code inside the upgrade class is never 
 called.
 
I think I should mistyped something. I am checking now.
 
 
On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote:
 
Miguel
 
You will need to call the external sql script from inside of 
 your Migration.java file.
 
@Override
public void upgrade(EOEditingContext editingContext, 
 ERXMigrationDatabase database) throws Throwable {

 

fromBlob is not called on ERXMutableDictionary with mutableDictionary prototype

2011-04-06 Thread Johnny Miller
Hello,

Did anyone ever find a solution for this problem?

http://lists.apple.com/archives/webobjects-dev/2007/Jan/msg00169.html

Apparently with MySQL there is an error with using the mutableDictionary 
prototype?  

I'm seeing the following error:

com.webobjects.eoaccess.EOGeneralAdaptorException: no such field keys with type 
class java.lang.Object
at 
com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseContextInformationAdded(EODatabaseContext.java:4504)
at 
com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseContext.java:6216)

Thanks in advance,

Johnny Miller
Kahalawai Media Corp
http://www.kahalawai.com



 ___
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 arch...@mail-archive.com


Newbie question

2011-04-06 Thread Mr Tonnew
Hi,

How do I avoid committing duplicate entries in the DB? I have a form
from where I take entries. Is there a single line of code that can
accomplish this?

MR
 ___
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 arch...@mail-archive.com


Re: postgresql schema ignored when adding foreign key

2011-04-06 Thread Michael Gargano
It looks like it's just fundamentally broken, FKs and unique indexes just don't 
work in other schemas for postgtgres.

For my fixes if you're curious.
http://issues.objectstyle.org/jira/browse/WONDER-696

Thanks Tim this info. was helpful.
-Mike


On Apr 6, 2011, at 12:14 AM, D Tim Cummings wrote:

Schemas don't work if you have the following property true

com.webobjects.jdbcadaptor.PostgresqlExpression.enableIdentifierQuoting=true

I have a patch to fix this in

http://issues.objectstyle.org/jira/browse/WONDER-489
Postgresql PlugIn inconsistent application of identifier quoting to table names 
with schemas - Migrations don't work


Regards

Tim Cummings

On 06/04/2011, at 2:27 AM, Michael Gargano wrote:



EOSchemaGeneration foreignKeyConstraintStatementsForRelationship() seems to 
ignore schemas.  Anyone else have problems with that when using addForeignKey() 
in a migration with tables with non-default schemas?  I tried to fix it on my 
own, but either my brain is too small or wonder is too complex... maybe both.  
:p

-Mike

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  
(Webobjects-dev@lists.apple.commailto:Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/tim%40triptera.com.au

This email sent to t...@triptera.com.au


 ___
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 arch...@mail-archive.com


Re: Newbie question

2011-04-06 Thread Paul D Yu
Based on the column/attribute in your DB/EOModel that would make your consider 
the record/EO to be duplicate of another, you should implement a method that 
would check for those values in the existing set.

I don't think there is a one line solution to what you are seeking.

Paul
On Apr 6, 2011, at 10:52 PM, Mr Tonnew wrote:

 Hi,
 
 How do I avoid committing duplicate entries in the DB? I have a form
 from where I take entries. Is there a single line of code that can
 accomplish this?
 
 MR
 ___
 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/pyu%40mac.com
 
 This email sent to p...@mac.com

 ___
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 arch...@mail-archive.com


Re: Newbie question

2011-04-06 Thread Chuck Hill
That is going to leave you with a race condition.  The only certain way to 
prevent the creation of duplicates is to put an unique constraint on the 
database.  Then you have to catch the database exception 
(EOGeneralAdaptorException) in your code and handle appropriately.  The ugly 
part is that the exception message returned is different for each database 
which makes doing this in a database agnostic way slightly challenging.

Chuck

On Apr 6, 2011, at 8:21 PM, Paul D Yu wrote:

 Based on the column/attribute in your DB/EOModel that would make your 
 consider the record/EO to be duplicate of another, you should implement a 
 method that would check for those values in the existing set.
 
 I don't think there is a one line solution to what you are seeking.
 
 Paul
 On Apr 6, 2011, at 10:52 PM, Mr Tonnew wrote:
 
 Hi,
 
 How do I avoid committing duplicate entries in the DB? I have a form
 from where I take entries. Is there a single line of code that can
 accomplish this?
 
 MR
 ___
 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/pyu%40mac.com
 
 This email sent to p...@mac.com
 
 ___
 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 ch...@global-village.net

-- 
Chuck Hill Senior Consultant / VP Development

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









smime.p7s
Description: S/MIME cryptographic signature
 ___
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 arch...@mail-archive.com


Re: Newbie question

2011-04-06 Thread Amiel Montecillo
I agree with Chuck. To display a more meaningful error message, I've been
putting a mapping in my ValidationTemplate.strings something like:

User.USERNAME_DUP_IDX = Username already exists;

where
User = modelname
USERNAME_DUP_IDX = name of your unique index.

HTH,
Amiel

On Thu, Apr 7, 2011 at 11:48 AM, Chuck Hill ch...@global-village.netwrote:

 That is going to leave you with a race condition.  The only certain way to
 prevent the creation of duplicates is to put an unique constraint on the
 database.  Then you have to catch the database exception
 (EOGeneralAdaptorException) in your code and handle appropriately.  The ugly
 part is that the exception message returned is different for each database
 which makes doing this in a database agnostic way slightly challenging.

 Chuck

 On Apr 6, 2011, at 8:21 PM, Paul D Yu wrote:

  Based on the column/attribute in your DB/EOModel that would make your
 consider the record/EO to be duplicate of another, you should implement a
 method that would check for those values in the existing set.
 
  I don't think there is a one line solution to what you are seeking.
 
  Paul
  On Apr 6, 2011, at 10:52 PM, Mr Tonnew wrote:
 
  Hi,
 
  How do I avoid committing duplicate entries in the DB? I have a form
  from where I take entries. Is there a single line of code that can
  accomplish this?
 
  MR
  ___
  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/pyu%40mac.com
 
  This email sent to p...@mac.com
 
  ___
  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 ch...@global-village.net

 --
 Chuck Hill Senior Consultant / VP Development

 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/bosyotech%40gmail.com

 This email sent to bosyot...@gmail.com


 ___
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 arch...@mail-archive.com