Re: confused

2019-02-13 Thread Kai Lochbaum
I’d guess from here:
https://github.com/wocommunity/wonder/blob/73ef902e88130c1d9398458affc23a68431a582a/Build/build/default.properties
wo.server.root = /Library/WebServer/Documents/WebObjects

You can override it via -Dproperty=value in the command line call.



Best regards,
Kai Lochbaum

--

Telefon: 069 / 65 00 96 - 17  |  E-Mail: 
lochb...@salient-doremus.de<mailto:lochb...@salient-doremus.de>

salient GmbH, Lindleystraße 12, 60314 Frankfurt
Telefon Zentrale: 069 / 65 00 96 - 0  |  
http://www.salient-doremus.de<http://www.salient-doremus.de/>

Von: Theodore Petrosky 
Datum: Mittwoch, 13. Februar 2019 um 15:30
An: WO 
Betreff: confused

I was setting up a new machine with wo and wonder and I have something weird so 
I thought I would ask. When you invoke the ant build and install of the 
frameworks, where does ant get  its properties from? so:


this installed the frameworks at
global.framework.web:
 [sync] Copying 5 files to 
/Library/WebServer/Documents/WebObjects/Frameworks/WOPayPal.framework/WebServerResources


cd ~/Repository/Wondersource
sudo ant -Duser.home=$HOME frameworks frameworks.install

I have a wolips.properties in my  ~/Library/Application\ Support/WOLips/

which has:

#Tue Feb 12 04:29:28 EST 2019
wo.api.root=/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.WebObjectsReference.docset/Contents/Resources/Documents/documentation/InternetWeb/Reference/WO542Reference
wo.apps.root=/Developer/WebObjects/Versions/WebObjects543/Library/WebObjects/Applications
wo.bootstrapjar=/System/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar
wo.extensions=/Developer/WebObjects/Versions/WebObjects543/Library/WebObjects/Extensions
wo.local.frameworks=/Developer/WebObjects/Versions/WebObjects543/Library/Frameworks
wo.local.root=/Developer/WebObjects/Versions/WebObjects543
wo.network.frameworks=/Developer/WebObjects/Versions/WebObjects543/Library/WebObjects/Extensions
wo.network.root=/Network
wo.system.frameworks=/Developer/WebObjects/Versions/WebObjects543/System/Library/Frameworks
wo.system.root=/Developer/WebObjects/Versions/WebObjects543/System
wo.user.frameworks=/Users/asacksadmin/Library/Frameworks
wo.user.root=/Users/asacksadmin
wolips.properties=wolips.properties

This looks to point to /Developer/.etc etc
I thought ant took its properties from wolips.properties  above

why is ant installing in /Library/……..?


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

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


confused

2019-02-13 Thread Theodore Petrosky
I was setting up a new machine with wo and wonder and I have something weird so 
I thought I would ask. When you invoke the ant build and install of the 
frameworks, where does ant get  its properties from? so:


this installed the frameworks at 
global.framework.web:
 [sync] Copying 5 files to 
/Library/WebServer/Documents/WebObjects/Frameworks/WOPayPal.framework/WebServerResources

cd ~/Repository/Wondersource
sudo ant -Duser.home=$HOME frameworks frameworks.install

I have a wolips.properties in my  ~/Library/Application\ Support/WOLips/

which has:

#Tue Feb 12 04:29:28 EST 2019
wo.api.root=/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.WebObjectsReference.docset/Contents/Resources/Documents/documentation/InternetWeb/Reference/WO542Reference
wo.apps.root=/Developer/WebObjects/Versions/WebObjects543/Library/WebObjects/Applications
wo.bootstrapjar=/System/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar
wo.extensions=/Developer/WebObjects/Versions/WebObjects543/Library/WebObjects/Extensions
wo.local.frameworks=/Developer/WebObjects/Versions/WebObjects543/Library/Frameworks
wo.local.root=/Developer/WebObjects/Versions/WebObjects543
wo.network.frameworks=/Developer/WebObjects/Versions/WebObjects543/Library/WebObjects/Extensions
wo.network.root=/Network
wo.system.frameworks=/Developer/WebObjects/Versions/WebObjects543/System/Library/Frameworks
wo.system.root=/Developer/WebObjects/Versions/WebObjects543/System
wo.user.frameworks=/Users/asacksadmin/Library/Frameworks
wo.user.root=/Users/asacksadmin
wolips.properties=wolips.properties

This looks to point to /Developer/.etc etc
I thought ant took its properties from wolips.properties  above

why is ant installing in /Library/……..?


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

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


Confused with delete rules in EntityModeler

2011-04-26 Thread Markus Ruggiero
Hi,

I have a fairly complex structure of several entities (actually this is not so 
complex after all). Eventually when I try to delete an ElectronicDocument (this 
is a pure ERD2W app, no custom delete() stuff) my application throws up with

java.lang.IllegalStateException: A valid global ID could not be obtained for 
entity named TextblockReference, relationship named textblocks, primary key 
dictionary {electronicDocumentID = 14; textblockID = 65; }.

I do not really understand what the problem is here but I think it might have 
something to do with delete rule specification in the model or the flattened 
relationship. What confuses me is that there are delete rules for both 
directions of a relationship which makes no sense to me. And what should those 
be for the flattened relationship?

Here is the model:

ElectronicDocument --TextblockReference--Textblock. TextblockReference is 
more than a simple m:n join table. However I have a flattened m:n relationship 
between ElectronicDocument (called textblocks) and Textblock (called documents) 
across TextblockReference. There are other entities hanging off 
TextblockReference: TextblockReferemce--Params--Data.

When I delete an ElectronicDocument I want all associated TextblocReferences 
and everything hanging off it be gone, however Textblock should stay around but 
not have that particular ElectronicDocument object in its flattened 
relationship anymore.

What would be the proper delete rules and why would I have to specify a delete 
rule for both directions (this is a general question)? It does not make sense 
to have a rule from the many to the one entity. Oh, and the DB is Oracle 9 and 
there are cascading FKs defined. I need those because there are some 3rd party 
apps messing with the data as well. Yes, ugly, but that's what the customer 
wants...

Thanks for any help
---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

Re: Confused with delete rules in EntityModeler

2011-04-26 Thread David Avendasora

On Apr 26, 2011, at 8:20 AM, Markus Ruggiero wrote:

 What confuses me is that there are delete rules for both directions of a 
 relationship which makes no sense to me.

Please give us more information about these two relationships. Cascade Delete 
rules should not go in both directions. I can't think of any valid uses, and it 
seems logical (To me. Shut-up Chuck) it would cause exactly what you are seeing.

 And what should those be for the flattened relationship?

I'm guessing that they should be nullify or do nothing

 
 Here is the model:
 
 ElectronicDocument --TextblockReference--Textblock. TextblockReference 
 is more than a simple m:n join table. However I have a flattened m:n 
 relationship between ElectronicDocument (called textblocks) and Textblock 
 (called documents) across TextblockReference. There are other entities 
 hanging off TextblockReference: TextblockReferemce--Params--Data.

All that seems perfectly fine.

 When I delete an ElectronicDocument I want all associated TextblocReferences 
 and everything hanging off it be gone, however Textblock should stay around 
 but not have that particular ElectronicDocument object in its flattened 
 relationship anymore.

That is exactly how it should work. There's either something wrong in your 
model, or the Oracle cascade delete is the culprit. Let's hope it's the model. 
That's in your control to fix.

Dave ___
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: Confused with delete rules in EntityModeler

2011-04-26 Thread David LeBer

On 2011-04-26, at 9:08 AM, David Avendasora wrote:

 
 On Apr 26, 2011, at 8:20 AM, Markus Ruggiero wrote:
 
 What confuses me is that there are delete rules for both directions of a 
 relationship which makes no sense to me.
 
 Please give us more information about these two relationships. Cascade Delete 
 rules should not go in both directions. I can't think of any valid uses, and 
 it seems logical (To me. Shut-up Chuck) it would cause exactly what you are 
 seeing.

A delete rule is not always cascade. So having delete rules in both directions 
is perfectly valid and often desirable. i.e: Cascade in one direction and deny 
in the other.

 
 And what should those be for the flattened relationship?
 
 I'm guessing that they should be nullify or do nothing

Yes, only one delete rule should affect a given relationship. In fact, I always 
shy away from (nay, avoid completely) flattened relationships that hide objects 
I am actually interested in. In general, 'one path to the object' is the rule I 
try to follow.

 
 
 Here is the model:
 
 ElectronicDocument --TextblockReference--Textblock. TextblockReference 
 is more than a simple m:n join table. However I have a flattened m:n 
 relationship between ElectronicDocument (called textblocks) and Textblock 
 (called documents) across TextblockReference. There are other entities 
 hanging off TextblockReference: TextblockReferemce--Params--Data.
 
 All that seems perfectly fine.

 
 When I delete an ElectronicDocument I want all associated TextblocReferences 
 and everything hanging off it be gone, however Textblock should stay around 
 but not have that particular ElectronicDocument object in its flattened 
 relationship anymore.
 
 That is exactly how it should work. There's either something wrong in your 
 model, or the Oracle cascade delete is the culprit. Let's hope it's the 
 model. That's in your control to fix.


Yeah, many to many are usually modelled like: Many1 --cascade- Many1Many2Join 
--cascade-- Many2

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
WOWODC 2011 :  July 1-2-3, Montreal. http://wowodc.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: Confused with delete rules in EntityModeler

2011-04-26 Thread David Avendasora

On Apr 26, 2011, at 9:28 AM, David LeBer wrote:

 
 On 2011-04-26, at 9:08 AM, David Avendasora wrote:
 
 
 On Apr 26, 2011, at 8:20 AM, Markus Ruggiero wrote:
 
 What confuses me is that there are delete rules for both directions of a 
 relationship which makes no sense to me.
 
 Please give us more information about these two relationships. Cascade 
 Delete rules should not go in both directions. I can't think of any valid 
 uses, and it seems logical (To me. Shut-up Chuck) it would cause exactly 
 what you are seeing.
 
 A delete rule is not always cascade. So having delete rules in both 
 directions is perfectly valid and often desirable. i.e: Cascade in one 
 direction and deny in the other.

Er.. Yes. That's what I meant. Cascade Delete Rules should not go in both 
directions. Other combinations certainly can.

 
 
 And what should those be for the flattened relationship?
 
 I'm guessing that they should be nullify or do nothing
 
 Yes, only one delete rule should affect a given relationship. In fact, I 
 always shy away from (nay, avoid completely) flattened relationships that 
 hide objects I am actually interested in. In general, 'one path to the 
 object' is the rule I try to follow.

Absolutely! +1,000,000. 

EOF gets horribly confused if you have multiple paths. Never, never, never have 
more than one relationship in an Entity share a FK, or have a FK be a class 
attribute because you can set one without setting the other, or set them 
independently to different values, try to delete one relationship and the other 
still sees it as being valid but the object is long gone.

Hmmm. That last one sounds familiar... :-)

 
 
 
 Here is the model:
 
 ElectronicDocument --TextblockReference--Textblock. 
 TextblockReference is more than a simple m:n join table. However I have a 
 flattened m:n relationship between ElectronicDocument (called textblocks) 
 and Textblock (called documents) across TextblockReference. There are other 
 entities hanging off TextblockReference: 
 TextblockReferemce--Params--Data.
 
 All that seems perfectly fine.
 
 
 When I delete an ElectronicDocument I want all associated 
 TextblocReferences and everything hanging off it be gone, however Textblock 
 should stay around but not have that particular ElectronicDocument object 
 in its flattened relationship anymore.
 
 That is exactly how it should work. There's either something wrong in your 
 model, or the Oracle cascade delete is the culprit. Let's hope it's the 
 model. That's in your control to fix.
 
 
 Yeah, many to many are usually modelled like: Many1 --cascade- 
 Many1Many2Join --cascade-- Many2
 
 ;david
 
 --
 David LeBer
 Codeferous Software
 'co-def-er-ous' adj. Literally 'code-bearing'
 site: http://codeferous.com
 blog: http://davidleber.net
 profile:  http://www.linkedin.com/in/davidleber
 twitter:  http://twitter.com/rebeld
 --
 WOWODC 2011 :  July 1-2-3, Montreal. http://wowodc.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: Confused with delete rules in EntityModeler

2011-04-26 Thread Markus Ruggiero
 Here is the model:
 
 ElectronicDocument --TextblockReference--Textblock. TextblockReference 
 is more than a simple m:n join table. However I have a flattened m:n 
 relationship between ElectronicDocument (called textblocks) and Textblock 
 (called documents) across TextblockReference. There are other entities 
 hanging off TextblockReference: TextblockReferemce--Params--Data.


On 26.04.2011, at 16:17, David Avendasora wrote:

 And what should those be for the flattened relationship?
 
 I'm guessing that they should be nullify or do nothing
 
 Yes, only one delete rule should affect a given relationship. In fact, I 
 always shy away from (nay, avoid completely) flattened relationships that 
 hide objects I am actually interested in. In general, 'one path to the 
 object' is the rule I try to follow.
 
 Absolutely! +1,000,000. 
 
 EOF gets horribly confused if you have multiple paths. Never, never, never 
 have more than one relationship in an Entity share a FK, or have a FK be a 
 class attribute because you can set one without setting the other, or set 
 them independently to different values, try to delete one relationship and 
 the other still sees it as being valid but the object is long gone.
 
 Hmmm. That last one sounds familiar... :-)

That makes sense and is what caused the problems in the end. I removed the 
flattened relationship between ElectronicDocument and Textblock from the model 
and replaced it by a simple cover method in ElectronicDocument.java -- all 
problems gone.

Thanks to The Davids :-)

---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


Models confused?

2010-12-22 Thread Jesse Tayler
I've had ERAttachment tests working once or twice, now I think maybe I've 
gotten models confused somewhere perhaps. 

I have a poster relationship from user which eogen's a line to add a foreign 
key, which I think should be there, but this step fails - in past experience, 
this has been mismatched id key types, but I don't see that here.

Everything is setup with id as a prototype for mysql.

I see some similar troubles with Postgres on the list or google, but I'm on 
Mysql and just starting a new dev. environment etc.

This foreign key should be there right? Any ideas why it might be failing?






userTable.addForeignKey(posterId, ERAttachment, id);

Can't create table 'mtly.#sql-731_26c3' (errno: 150)

Failed to execute 'ALTER TABLE USER ADD CONSTRAINT USER_posterId_posterId_FK 
FOREIGN KEY (posterId) REFERENCES ERAttachment (id)'.




If I ignore, I'll get a runtime:




com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression failed: : 
Next exception:SQL State:23000 -- error code: 1452 -- msg: Cannot add or update 
a child row: a foreign key constraint fails (`mtly`.`ERAttachment`, CONSTRAINT 
`ERAttachment_attachmentDataID_attachmentDataID_FK` FOREIGN KEY 
(`attachmentDataID`) REFERENCES `ERAttachmentData` (`id`))

Reason:
EvaluateExpression failed: 
com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: INSERT INTO 
ERAttachment(size, width, height, attachmentDataID, available, thumbnail, 
creationDate, ownerID, configurationName, smallData, mimeType, 
originalFileName, webPath, id, proxied, storageType) VALUES (?, NULL, NULL, ?, 
?, NULL, ?, NULL, NULL, NULL, ?, ?, ?, ?, ?, ?) withBindings: 1:73207(size), 
2:2(attachmentDataID), 3:true(available), 4:2010-12-21 22:23:33(creationDate), 
5:image/jpeg(mimeType), 6:jesseheadshot.jpg(originalFileName), 
7:/2.jpg(webPath), 8:2(id), 9:true(proxied), 10:db(storageType): Next 
exception:SQL State:23000 -- error code: 1452 -- msg: Cannot add or update a 
child row: a foreign key constraint fails (`mtly`.`ERAttachment`, CONSTRAINT 
`ERAttachment_attachmentDataID_attachmentDataID_FK` FOREIGN KEY 
(`attachmentDataID`) REFERENCES `ERAttachmentData` (`id`))
 ___
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: Models confused?

2010-12-22 Thread Paul D Yu
Jesse

I believe foreignKeys do not work on MySQL with EOF.

Paul
On Dec 22, 2010, at 12:53 PM, Jesse Tayler wrote:

 I've had ERAttachment tests working once or twice, now I think maybe I've 
 gotten models confused somewhere perhaps. 
 
 I have a poster relationship from user which eogen's a line to add a foreign 
 key, which I think should be there, but this step fails - in past experience, 
 this has been mismatched id key types, but I don't see that here.
 
 Everything is setup with id as a prototype for mysql.
 
 I see some similar troubles with Postgres on the list or google, but I'm on 
 Mysql and just starting a new dev. environment etc.
 
 This foreign key should be there right? Any ideas why it might be failing?
 
 
 
 
 
 
   userTable.addForeignKey(posterId, ERAttachment, id);
 
 Can't create table 'mtly.#sql-731_26c3' (errno: 150)
 
 Failed to execute 'ALTER TABLE USER ADD CONSTRAINT USER_posterId_posterId_FK 
 FOREIGN KEY (posterId) REFERENCES ERAttachment (id)'.
 
 
 
 
 If I ignore, I'll get a runtime:
 
 
 
 
 com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression failed: 
 : Next exception:SQL State:23000 -- error code: 1452 -- msg: Cannot add or 
 update a child row: a foreign key constraint fails (`mtly`.`ERAttachment`, 
 CONSTRAINT `ERAttachment_attachmentDataID_attachmentDataID_FK` FOREIGN KEY 
 (`attachmentDataID`) REFERENCES `ERAttachmentData` (`id`))
 
 Reason:
 EvaluateExpression failed: 
 com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: INSERT INTO 
 ERAttachment(size, width, height, attachmentDataID, available, thumbnail, 
 creationDate, ownerID, configurationName, smallData, mimeType, 
 originalFileName, webPath, id, proxied, storageType) VALUES (?, NULL, NULL, 
 ?, ?, NULL, ?, NULL, NULL, NULL, ?, ?, ?, ?, ?, ?) withBindings: 
 1:73207(size), 2:2(attachmentDataID), 3:true(available), 4:2010-12-21 
 22:23:33(creationDate), 5:image/jpeg(mimeType), 
 6:jesseheadshot.jpg(originalFileName), 7:/2.jpg(webPath), 8:2(id), 
 9:true(proxied), 10:db(storageType): Next exception:SQL State:23000 -- 
 error code: 1452 -- msg: Cannot add or update a child row: a foreign key 
 constraint fails (`mtly`.`ERAttachment`, CONSTRAINT 
 `ERAttachment_attachmentDataID_attachmentDataID_FK` FOREIGN KEY 
 (`attachmentDataID`) REFERENCES `ERAttachmentData` (`id`))
 ___
 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: Models confused?

2010-12-22 Thread Chuck Hill

On Dec 22, 2010, at 10:30 AM, Ramsey Gurley wrote:

 MySQL does not have deferred fk constraints.  EOF doesn't order operations, 
 it just commits en masse.  So, if you want to use fk constraints with MySQL, 
 you have to order the operations yourself.  There is some magic in wonder for 
 this
 
 http://lists.apple.com/archives/Webobjects-dev/2007/Jun/msg00751.html
 
 However, keep in mind that required, circular relationships cannot be modeled 
 in MySQL if you use FK constraints.  If the relationship is circular, no 
 amount of operation ordering will fix your problem AFAIK.

You could possibly order by the PK/FK if the relationship was A-B-C in the 
same table.  If it is A-B, then that is not possible.


 Or you can just turn off constraints and live dangerously... or switch to 
 Postgres.  It's free and has deferred FK constraints. Or Frontbase or if 
 you're made out of money, Oracle...  I even read SQLite has deferred FKs... 
 cool! (^_^)

Microsoft SQL Server does not support deferred constraints either, so MySQL is 
in good company!  :-P


Chuck


 On Dec 22, 2010, at 1:13 PM, Jesse Tayler wrote:
 
 Hi Paul
 
 thanks for your reply -- but
 
 How do you mean?
 
 I establish other foreign keys on other tables without troubles? Their SQL 
 runs. this line is my only trouble - I thought it was mismatched id types 
 for some reason, but you think the trouble is in my model somewhere?
 
 
 
 
 On Dec 22, 2010, at 12:54 PM, Paul D Yu wrote:
 
 Jesse
 
 I believe foreignKeys do not work on MySQL with EOF.
 
 Paul
 On Dec 22, 2010, at 12:53 PM, Jesse Tayler wrote:
 
 I've had ERAttachment tests working once or twice, now I think maybe I've 
 gotten models confused somewhere perhaps.
 
 I have a poster relationship from user which eogen's a line to add a 
 foreign key, which I think should be there, but this step fails - in past 
 experience, this has been mismatched id key types, but I don't see that 
 here.
 
 Everything is setup with id as a prototype for mysql.
 
 I see some similar troubles with Postgres on the list or google, but I'm 
 on Mysql and just starting a new dev. environment etc.
 
 This foreign key should be there right? Any ideas why it might be failing?
 
 
 
 
 
 
userTable.addForeignKey(posterId, ERAttachment, id);
 
 Can't create table 'mtly.#sql-731_26c3' (errno: 150)
 
 Failed to execute 'ALTER TABLE USER ADD CONSTRAINT 
 USER_posterId_posterId_FK FOREIGN KEY (posterId) REFERENCES ERAttachment 
 (id)'.
 
 
 
 
 If I ignore, I'll get a runtime:
 
 
 
 
 com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression 
 failed: : Next exception:SQL State:23000 -- error code: 1452 -- msg: 
 Cannot add or update a child row: a foreign key constraint fails 
 (`mtly`.`ERAttachment`, CONSTRAINT 
 `ERAttachment_attachmentDataID_attachmentDataID_FK` FOREIGN KEY 
 (`attachmentDataID`) REFERENCES `ERAttachmentData` (`id`))
 
 Reason:
 EvaluateExpression failed: 
 com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: INSERT INTO 
 ERAttachment(size, width, height, attachmentDataID, available, thumbnail, 
 creationDate, ownerID, configurationName, smallData, mimeType, 
 originalFileName, webPath, id, proxied, storageType) VALUES (?, NULL, 
 NULL, ?, ?, NULL, ?, NULL, NULL, NULL, ?, ?, ?, ?, ?, ?) withBindings: 
 1:73207(size), 2:2(attachmentDataID), 3:true(available), 4:2010-12-21 
 22:23:33(creationDate), 5:image/jpeg(mimeType), 
 6:jesseheadshot.jpg(originalFileName), 7:/2.jpg(webPath), 8:2(id), 
 9:true(proxied), 10:db(storageType): Next exception:SQL State:23000 -- 
 error code: 1452 -- msg: Cannot add or update a child row: a foreign key 
 constraint fails (`mtly`.`ERAttachment`, CONSTRAINT 
 `ERAttachment_attachmentDataID_attachmentDataID_FK` FOREIGN KEY 
 (`attachmentDataID`) REFERENCES `ERAttachmentData` (`id`))
 ___
 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/ramsey%40xeotech.com
 
 This email sent to ram...@xeotech.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

Re: Models confused?

2010-12-22 Thread Jesse Tayler
whoa! unexpected can-o-worms!

I guess I had been using FrontBase...But now I'm on mysql via amazon RDS which 
really seems like a nice service.

I really could care less about how keys are constrained really, I have a new 
WO-centric data model and WO is the main handler of the data and this is a new 
setup, so the path of greatest WO'ness is the clear choice.

 1. The FK and the ID it's pointing to are the same field types.

well, they really do all seem to be properly inheriting from ID prototype and 
aside from being marked as non-required and I guess I turned off locking for 
that property...the ER tables are getting created from scratch at the same time 
etc.

 2. (Most likely) the table must be InnoDB, not MyISAM. MyISAM does not 
 support FK constraints.

the tables do seem to be inoDB (whatever that is) and utf-8 in the hope of 
capturing various languages properly.

I wonder this - I have at least one table that I was using that is a 
correlation table (invitation) and the eogen makes key constraints for  that 
table -- the trouble comes for me when I connect to the ERAttachemnt model.

NOW -- I did have some trouble with that relationship while getting started, I 
know I had to delete a framework I had somehow imported and changed in order to 
get it in sync with the deployment model which I bundle up with the app. (I'm 
also new to eclipse)

I really thought I had a model confusion going on...something stemming from 
that duplicate model or something.

Also note -- I have been able to upload photos while I've been dropping and 
recreating tables and model files and testing things.

If I recall, I opted out of the egoen'd key constraint and some point and was 
able to store attachments without the error message at runtime - but it has 
been inconsistent and of course, if I could recall the recipe and it worked, 
I'd just stick with it.

Thoughts?

Should I opt away from constraints anyway? Model setting I should try?


 ___
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: Models confused?

2010-12-22 Thread Travis Britt
I doubt it's the model. Either drop constraints or try to use them with 
dependency ordering. If you want to try them and are certain both tables 
involved are InnoDB, look at the column definitions in the database to ensure 
they have exactly the same definition.  Those are the only two things I'm aware 
of that can cause that MySQL error.

tb


On Dec 22, 2010, at 1:51 PM, Jesse Tayler wrote:
 Thoughts?
 
 Should I opt away from constraints anyway? Model setting I should try?

 ___
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: Models confused?

2010-12-22 Thread David Avendasora

On Dec 22, 2010, at 1:51 PM, Jesse Tayler wrote:

 whoa! unexpected can-o-worms!
 
 I guess I had been using FrontBase...But now I'm on mysql via amazon RDS 
 which really seems like a nice service.
 
 I really could care less about how keys are constrained really, I have a new 
 WO-centric data model and WO is the main handler of the data and this is a 
 new setup, so the path of greatest WO'ness is the clear choice.
 
 1. The FK and the ID it's pointing to are the same field types.
 
 well, they really do all seem to be properly inheriting from ID prototype and 
 aside from being marked as non-required and I guess I turned off locking for 
 that property...the ER tables are getting created from scratch at the same 
 time etc.
 
 2. (Most likely) the table must be InnoDB, not MyISAM. MyISAM does not 
 support FK constraints.
 
 the tables do seem to be inoDB (whatever that is) and utf-8 in the hope of 
 capturing various languages properly.
 
 I wonder this - I have at least one table that I was using that is a 
 correlation table (invitation) and the eogen makes key constraints for  that 
 table -- the trouble comes for me when I connect to the ERAttachemnt model.
 
 NOW -- I did have some trouble with that relationship while getting started, 
 I know I had to delete a framework I had somehow imported and changed in 
 order to get it in sync with the deployment model which I bundle up with the 
 app. (I'm also new to eclipse)
 
 I really thought I had a model confusion going on...something stemming from 
 that duplicate model or something.
 
 Also note -- I have been able to upload photos while I've been dropping and 
 recreating tables and model files and testing things.
 
 If I recall, I opted out of the egoen'd key constraint and some point and was 
 able to store attachments without the error message at runtime - but it has 
 been inconsistent and of course, if I could recall the recipe and it worked, 
 I'd just stick with it.
 
 Thoughts?

EOF doesn't do DB operations in a predictable/consistent/deterministic way. If 
it worked before in MySQL with FK constraints in the DB, then it was just luck. 
EOF could easily just have inserted things in the right order by complete 
chance. I used MSSQL Server on a previous project and it took a while for me to 
figure out why sometimes the same transaction would fail and other times it 
would run just fine. If you have non-deferrable FK constraints in the DB you 
must either force EOF to do things in the right order, or remove the 
constraints.

There is code that Chuck wrote (that others have eluded to) that will put 99% 
of normal DB operations in the correct order. Use it. Don't look back.

 Should I opt away from constraints anyway? Model setting I should try?

NO! Use constraints. Use them. USE THEM! You say that WO is the main handler of 
the data, but sooner or later something else is going to touch the data (could 
be another app, could be you running SQL commands from the console) and the 
database will allow you to happily have FKs that point to nothing, which EOF 
will also choke on (although there's a way to force it to swallow it using 
Wonder).

Use the Entity Ordering code of Chuck's. I believe you just add a line of code 
to the Application constructor to use an Entity Ordering Delegate (not sure, 
it's been a while, google is your friend). And only remove the FK constraints 
on self-referential relationships.

Dave


 ___
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: Models confused?

2010-12-22 Thread David Avendasora
For reference: 
http://lists.apple.com/archives/webobjects-dev/2008/Feb/msg00478.html

On Dec 22, 2010, at 2:14 PM, David Avendasora wrote:

 
 On Dec 22, 2010, at 1:51 PM, Jesse Tayler wrote:
 
 whoa! unexpected can-o-worms!
 
 I guess I had been using FrontBase...But now I'm on mysql via amazon RDS 
 which really seems like a nice service.
 
 I really could care less about how keys are constrained really, I have a new 
 WO-centric data model and WO is the main handler of the data and this is a 
 new setup, so the path of greatest WO'ness is the clear choice.
 
 1. The FK and the ID it's pointing to are the same field types.
 
 well, they really do all seem to be properly inheriting from ID prototype 
 and aside from being marked as non-required and I guess I turned off locking 
 for that property...the ER tables are getting created from scratch at the 
 same time etc.
 
 2. (Most likely) the table must be InnoDB, not MyISAM. MyISAM does not 
 support FK constraints.
 
 the tables do seem to be inoDB (whatever that is) and utf-8 in the hope of 
 capturing various languages properly.
 
 I wonder this - I have at least one table that I was using that is a 
 correlation table (invitation) and the eogen makes key constraints for  that 
 table -- the trouble comes for me when I connect to the ERAttachemnt model.
 
 NOW -- I did have some trouble with that relationship while getting started, 
 I know I had to delete a framework I had somehow imported and changed in 
 order to get it in sync with the deployment model which I bundle up with the 
 app. (I'm also new to eclipse)
 
 I really thought I had a model confusion going on...something stemming from 
 that duplicate model or something.
 
 Also note -- I have been able to upload photos while I've been dropping and 
 recreating tables and model files and testing things.
 
 If I recall, I opted out of the egoen'd key constraint and some point and 
 was able to store attachments without the error message at runtime - but it 
 has been inconsistent and of course, if I could recall the recipe and it 
 worked, I'd just stick with it.
 
 Thoughts?
 
 EOF doesn't do DB operations in a predictable/consistent/deterministic way. 
 If it worked before in MySQL with FK constraints in the DB, then it was just 
 luck. EOF could easily just have inserted things in the right order by 
 complete chance. I used MSSQL Server on a previous project and it took a 
 while for me to figure out why sometimes the same transaction would fail and 
 other times it would run just fine. If you have non-deferrable FK constraints 
 in the DB you must either force EOF to do things in the right order, or 
 remove the constraints.
 
 There is code that Chuck wrote (that others have eluded to) that will put 99% 
 of normal DB operations in the correct order. Use it. Don't look back.
 
 Should I opt away from constraints anyway? Model setting I should try?
 
 NO! Use constraints. Use them. USE THEM! You say that WO is the main handler 
 of the data, but sooner or later something else is going to touch the data 
 (could be another app, could be you running SQL commands from the console) 
 and the database will allow you to happily have FKs that point to nothing, 
 which EOF will also choke on (although there's a way to force it to swallow 
 it using Wonder).
 
 Use the Entity Ordering code of Chuck's. I believe you just add a line of 
 code to the Application constructor to use an Entity Ordering Delegate (not 
 sure, it's been a while, google is your friend). And only remove the FK 
 constraints on self-referential relationships.
 
 Dave
 
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
 
 This email sent to webobje...@avendasora.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: Models confused?

2010-12-22 Thread Jesse Tayler

On Dec 22, 2010, at 2:11 PM, Travis Britt wrote:

 I doubt it's the model.

Right --

On Dec 22, 2010, at 2:14 PM, David Avendasora wrote:

 There is code that Chuck wrote (that others have eluded to) that will put 99% 
 of normal DB operations in the correct order. Use it. Don't look back.

Ok, thanks for jumping to the conclusion for me! 

I can see this is exactly what's going on - I've had the luck of the draw while 
saving, and as I come out of testing things don't seemer, reliable.

I see Chuck's workaround has an ordering system which does indeed seem like it 
would work.

I'll report back after I've had a chance to review that.


 For reference: 
 http://lists.apple.com/archives/webobjects-dev/2008/Feb/msg00478.html

ah, I hadn't seen that yet either -- I'll review as well.

thanks again!


 ___
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: Models confused?

2010-12-22 Thread Travis Britt
On Dec 22, 2010, at 2:21 PM, David Avendasora wrote:
 Use the Entity Ordering code of Chuck's. I believe you just add a line of 
 code to the Application constructor to use an Entity Ordering Delegate (not 
 sure, it's been a while, google is your friend). And only remove the FK 
 constraints on self-referential relationships.


Property, now, IIRC:

com.webobjects.eoaccess.ERXEntityDependencyOrderingDelegate.active = true

tb

 ___
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: Models confused?

2010-12-22 Thread Chuck Hill
On Dec 22, 2010, at 11:14 AM, David Avendasora wrote:
 On Dec 22, 2010, at 1:51 PM, Jesse Tayler wrote:
 
 EOF doesn't do DB operations in a predictable/consistent/deterministic way.

That is worth repeating as it is not obvious or expected for code to behave in 
a non-determinsitic way. 


 If it worked before in MySQL with FK constraints in the DB, then it was just 
 luck. EOF could easily just have inserted things in the right order by 
 complete chance. I used MSSQL Server on a previous project and it took a 
 while for me to figure out why sometimes the same transaction would fail and 
 other times it would run just fine.

I also have had the same experience, so for once is it not just Dave being 
Dave.  :-)



 If you have non-deferrable FK constraints in the DB you must either force EOF 
 to do things in the right order, or remove the constraints.
 
 There is code that Chuck wrote (that others have eluded to) that will put 99% 
 of normal DB operations in the correct order. Use it. Don't look back.
 
 Should I opt away from constraints anyway? Model setting I should try?
 
 NO! Use constraints. Use them. USE THEM! You say that WO is the main handler 
 of the data, but sooner or later something else is going to touch the data 
 (could be another app, could be you running SQL commands from the console) 
 and the database will allow you to happily have FKs that point to nothing, 
 which EOF will also choke on (although there's a way to force it to swallow 
 it using Wonder).

I once advocated not using FK constraints.  I got better.  Don't make my 
mistakes.


Chuck

 
 Use the Entity Ordering code of Chuck's. I believe you just add a line of 
 code to the Application constructor to use an Entity Ordering Delegate (not 
 sure, it's been a while, google is your friend). And only remove the FK 
 constraints on self-referential relationships.
 
 Dave
 
 
 ___
 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: Models confused?

2010-12-22 Thread Jesse Tayler
Thanks Travis, 

I had just found that property in the java files somewhere and it does seem to 
make the save reliable.

Nice. 

(seems like a required bit for those using Mysql, as I'm not aware of any 
downside.)

However, I still had to avoid that one particular constraint in order to get 
the table's to build, which seems to indicate I have at least one database 
issue remaining, no?

eogen lines like this run fine:

commentTable.addForeignKey(mtlyID, MTLY_POST, id);

If I avoid this key constraint, say, by commenting out the line, the database 
migrates without error -

userTable.addForeignKey(posterId, ERAttachment, id);

and after that, if I then use the save sort ordering, the file upload functions 
and I haven't got an error in two or three tries with it.

doesn't the fact that I can't run that SQL bit there mean there's a mismatch or 
something on the database itself?

mysql reports error 105 which I thought meant I had a mismatch of key types, 
but for the life of me, I don't see anything in the model or the 
database...hmm...


 ___
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


WO 5.4 and Confused / Stateless components

2008-04-24 Thread Alex Cone

Hi!

I just converted a project to WO 5.4 and I'm seeing very odd behavior/ 
errors with my stateless components.  Basically...


a) the application seems to be  trying to synchronize bindings,  
leading to:


This WOComponent does not have an instance variable of the name foo or  
_foo, nor a method of the name setFoo or _setFoo' object  
'com.webobjects.appserver.WOComponent name: FooStateless  
subcomponents: null ' key 'foo'


(The component inherits from a generic stateless component that  
returns isStaeless is true, synchronizesVariablesWithBindings is false.)


b) the actual code for the component seems to be being ignored (though  
there is no error message like one usually gets when the java class  
cannot be found and we fall back to a generic WOComponent).  If I  
break in my class's constructor the breakpoint is never hit.


The second problem would probably account for the first problem.  The  
component in question is in a framework project in my Eclipse  
workspace...


abc

__alex cone
ceo  c o d e f a b  llc
[EMAIL PROTECTED]
212.465.8484 x101
http://www.codefab.com

If you are not living on the edge, you are taking up too much space.




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

This email sent to [EMAIL PROTECTED]