On 2011-10-01, at 4:31 AM, Jeff Schmitz wrote:
> Well, I thought I was, but apparently I wasn't. After deleting all my wonder
> framework projects (I'm using them from source), updating my Wonder source
> from git, and re-adding them back into my workspace and build path, the
> constraint is now being created DEFERRED INITIALLY DEFERRED. I also put a
> break point in the wonder source in function
> foreignKeyConstraintStatementsForRelationship, and it is getting hit for
> every addForeignKey call in my migration code.
>
> In the meantime though, I re-designed my database to remove the problem
> problem foreign key that was setup with owns destination and propagate id, so
> not sure if this would have fixed my original problem or not.
It would have. That is its purpose.
Chuck
>
> As always, thanks much for you help.
>
> Jeff
>
> On Sep 30, 2011, at 3:04 PM, Chuck Hill wrote:
>
>>
>> On 2011-09-30, at 12:18 PM, Jeff Schmitz wrote:
>>
>>> Yes, it is also set to "Owns Destination". It's "to-one" from Pool to
>>> Pricing, but I didn't create a return relationship in the Pricing EO, so I
>>> don't know if you would consider that one-to-one. It is mandatory though.
>>>
>>> Deferrable is set to No, Check Time is set to Initially Immediate.
>>
>> That part is wrong. DEFERRED INITIALLY DEFERRED is what you want. Entity
>> Modeler or Migrations SHOULD be generating that for you. You are using the
>> Wonder Frontbase plugin, right?
>>
>> Chuck
>>
>>
>>>
>>> Oh, and after dropping and restoring the DB on my dev machine, the error is
>>> now reproducible on it too.
>>>
>>> On Sep 30, 2011, at 1:54 PM, Chuck Hill wrote:
>>>
>>>> If it also Owns Destination (I think) and is to-one, then EOF will
>>>> automatically create it. Otherwise you need to create it.
>>>>
>>>> Is the Pricing relationship optional or mandatory?
>>>>
>>>> Is that constraint marked as DEFERRED INITIALLY DEFERRED?
>>>>
>>>>
>>>> Chuck
>>>>
>>>>
>>>> On 2011-09-30, at 11:47 AM, Jeff Schmitz wrote:
>>>>
>>>>> Yep, that's the clue I needed. There's a defined relationship from Pool
>>>>> to another EO (Pricing) that I created with "Propagates primary key".
>>>>> Should such objects get created automatically in the "createxxx" function
>>>>> of the parent EO code generated by EOModeler? Seems like they would have
>>>>> to be to keep the ID's in sync, but I'm not seeing it in the generated
>>>>> code.
>>>>>
>>>>>
>>>>> On Sep 30, 2011, at 12:12 PM, Chuck Hill wrote:
>>>>>
>>>>>> Connect to that database using FrontBaseManager. Go to Schema Objects,
>>>>>> select that table and click the Open Definition button. Click Foreign
>>>>>> Key and see what is really set for that table. It looks like perhaps
>>>>>> you have made a self-referencing FK constraint.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 2011-09-29, at 9:44 PM, Jeff Schmitz wrote:
>>>>>>
>>>>>>> Hello all,
>>>>>>> For some reason I'm seeing the below constraint violation when I try to
>>>>>>> insert a new EO into my database (frontbase). I checked the database,
>>>>>>> and in the t_pool table, no row exists that has the ID of the row being
>>>>>>> inserted (1000002), but every time I try to insert a new row I get the
>>>>>>> below exception. Also, this build runs fine on my development machine,
>>>>>>> it's only on the deployment machine where I'm seeing this. I've tried
>>>>>>> dropping the database, re-generating my migration code and installing
>>>>>>> the new build from scratch, but no luck.
>>>>>>>
>>>>>>> I am a little confused by where it says the violation is occurring:
>>>>>>>
>>>>>>> Integrity constraint violation (FOREIGN KEY,
>>>>>>> t_pool.t_pool_id_id_FK(id=1000002)).
>>>>>>>
>>>>>>> as I don't know why it would be considered a foreign key since it's the
>>>>>>> ID of the row being added, but then I'm no low level DB expert (one of
>>>>>>> the reasons I use webobjects :-))
>>>>>>>
>>>>>>>
>>>>>>> Any ideas?
>>>>>>>
>>>>>>>
>>>>>>> evaluateExpression:
>>>>>>> <com.webobjects.jdbcadaptor.FrontbasePlugIn$FrontbaseExpression:
>>>>>>> "INSERT INTO "t_pool"("c_spare_string", "c_name", "c_paid",
>>>>>>> "c_admin_email", "c_can_i_wins_calculated", "c_ud_bonus",
>>>>>>> "c_possibilities", "c_admin_pw", "c_weighted", "c_password",
>>>>>>> "c_stand_alone", "c_early_bird_paid", "c_entry_limit",
>>>>>>> "c_can_i_win_index", "c_seed_type", "c_admin_msg",
>>>>>>> "c_calculating_can_i_wins", "id", "c_pool_type", "c_updating_results",
>>>>>>> "applicationStateID", "c_results_index", "c_allow_one_entry_per_user")
>>>>>>> VALUES ('', 'ZEBRAS NEW 401K PLAN', 'false', '[email protected]', 'false',
>>>>>>> 'false', 1, 'pw', 'false', 'pw', 'false', 'false', 0, 0, 0, NULL,
>>>>>>> 'false', 1000002, 1, 'false', 1000001, 0, 'false')" withBindings: >
>>>>>>> Sep 29 22:40:39 netBrackets[2002] (ERXDatabaseContextDelegate.java:177)
>>>>>>> INFO er.transaction.adaptor.Exceptions - Database Exception occured:
>>>>>>> com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression
>>>>>>> failed:
>>>>>>> <com.webobjects.jdbcadaptor.FrontbasePlugIn$FrontbaseExpression:
>>>>>>> "INSERT INTO "t_pool"("c_spare_string", "c_name", "c_paid",
>>>>>>> "c_admin_email", "c_can_i_wins_calculated", "c_ud_bonus",
>>>>>>> "c_possibilities", "c_admin_pw", "c_weighted", "c_password",
>>>>>>> "c_stand_alone", "c_early_bird_paid", "c_entry_limit",
>>>>>>> "c_can_i_win_index", "c_seed_type", "c_admin_msg",
>>>>>>> "c_calculating_can_i_wins", "id", "c_pool_type", "c_updating_results",
>>>>>>> "applicationStateID", "c_results_index", "c_allow_one_entry_per_user")
>>>>>>> VALUES ('', 'ZEBRAS NEW 401K PLAN', 'false', '[email protected]', 'false',
>>>>>>> 'false', 1, 'pw', 'false', 'pw', 'false', 'false', 0, 0, 0, NULL,
>>>>>>> 'false', 1000002, 1, 'false', 1000001, 0, 'false')" withBindings: >:
>>>>>>> Next exception:SQL State:23 subclass = 00 -- error code: 361 --
>>>>>>> msg: Exception condition 361. Integrity constraint violation (FOREIGN
>>>>>>> KEY, t_pool.t_pool_id_id_FK(id=1000002)).
>>>>>>> Next exception:SQL State:40 subclass = 00 -- error code: 363 --
>>>>>>> msg: Exception condition 363. Transaction rollback.
>>>>>>> Sep 29 22:40:39 netBrackets[2002] (ERXNSLogLog4jBridge.java:46) DEBUG
>>>>>>> NSLog - === Rollback Internal Transaction
>>>>>>> com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression
>>>>>>> failed:
>>>>>>> <com.webobjects.jdbcadaptor.FrontbasePlugIn$FrontbaseExpression:
>>>>>>> "INSERT INTO "t_pool"("c_spare_string", "c_name", "c_paid",
>>>>>>> "c_admin_email", "c_can_i_wins_calculated", "c_ud_bonus",
>>>>>>> "c_possibilities", "c_admin_pw", "c_weighted", "c_password",
>>>>>>> "c_stand_alone", "c_early_bird_paid", "c_entry_limit",
>>>>>>> "c_can_i_win_index", "c_seed_type", "c_admin_msg",
>>>>>>> "c_calculating_can_i_wins", "id", "c_pool_type", "c_updating_results",
>>>>>>> "applicationStateID", "c_results_index", "c_allow_one_entry_per_user")
>>>>>>> VALUES ('', 'ZEBRAS NEW 401K PLAN', 'false', '[email protected]', 'false',
>>>>>>> 'false', 1, 'pw', 'false', 'pw', 'false', 'false', 0, 0, 0, NULL,
>>>>>>> 'false', 1000002, 1, 'false', 1000001, 0, 'false')" withBindings: >:
>>>>>>> Next exception:SQL State:23 subclass = 00 -- error code: 361 --
>>>>>>> msg: Exception condition 361. Integrity constraint violation (FOREIGN
>>>>>>> KEY, t_pool.t_pool_id_id_FK(id=1000002)).
>>>>>>> Next exception:SQL State:40 subclass = 00 -- error code: 363 --
>>>>>>> msg: Exception condition 363. Transaction rollback.
>>>>>>> at
>>>>>>> com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseContextInformationAdded(EODatabaseContext.java:4504)
>>>>>>> at
>>>>>>> com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseContext.java:6216)
>>>>>>> at
>>>>>>> com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:376)
>>>>>>> at
>>>>>>> com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
>>>>>>> at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:1094)
>>>>>>> at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1016)
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>> Webobjects-dev mailing list ([email protected])
>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>>>>>>>
>>>>>>> This email sent to [email protected]
>>>>>>
>>>>>> --
>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> --
>>>> 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
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>> --
>> 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
>>
>>
>>
>>
>>
>>
>>
>
--
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 ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]