• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WebObjects Error in Wonder D2W when populating MS SQL Server example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebObjects Error in Wonder D2W when populating MS SQL Server example


  • Subject: Re: WebObjects Error in Wonder D2W when populating MS SQL Server example
  • From: David Avendasora <email@hidden>
  • Date: Mon, 29 Sep 2008 09:34:43 -0400

Yes, I'm a little late to the game here, but...

On Sep 26, 2008, at 2:14 PM, Chuck Hill wrote:

You can manually create this table with:

CREATE TABLE EO_PK_TABLE (NAME CHAR(40) PRIMARY KEY, PK INT);

Heads-up on something that bit me. I am a firm believer in naming DBTables something human readable that says what it is for. (I've spent _way_ too much time trying to figure out what the Inventory item table is only to discover it is "IV01201" (thanks GreatPlains >:-( ).


So, to make a long story short, a length of 40 wasn't enough for me. I use CHAR(80). WO seems to be okay with that.

And I believe that by using a CHAR(80) that makes WO twice as fast as CHAR(40), right?

A couple of other SQL Server pointers:

- timestamps are only accurate to 3ms, Java SQL timestamps are accurate to 1. This can cause update failures if you attempt to lock on timestamp columns. I do want to lock on them, so I manually force all timestamps to have 0ms.

How do you do this? Is it part of your EOGenerator templates? Or do you just manually override any timestamp setters (I can't imagine you doing that, yuck)?


I'm currently not locking on any timestamps, and don't _really_ need to right now, but I would much rather include them just to be more future-proof.

- SQL Server does not support deferred constraints (along with several other standard SQL things, but I won't get started on that). Thus, the EOF operations may need to be re-ordered before execution on the DB server to avoid spurious constraint failures. I will attach a custom plugin that handles this (correctly, AFAIK, bug reports welcome).

This is huge, because EOF doesn't always perform DB operations in the same order every time, so you may start you project and everything run beautifully, only weeks/months later you start getting intermittent DB errors about FK constraints. Chucks plug-in forces WO to do things in the "logical" order. You can still paint yourself into a corner, especially with Single-Table inheritance and self-referential relationships, but this will solve 99.9999% of all constraint issues.


Your only other option with MS SQL Server is to remove the constraints from the DB tables and rely on EOF to manage your referential integrity, which it can do if your model is solid and WO is the only thing adding/removing data from your DB.

As a great author once said, "The database is merely an artifact of implementation."

Yes, the quote is taken out of context, but I find it to be a good reality check when I'm trying to decide what to do when EOF and the DB seem to be at odds with one another.

Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >WebObjects Error in Wonder D2W when populating MS SQL Server example (From: Daniel Beatty <email@hidden>)
 >Re: WebObjects Error in Wonder D2W when populating MS SQL Server example (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Eclipse WOLips not showing prototypes when creating a project
  • Next by Date: java.lang.ClassCastException
  • Previous by thread: Re: WebObjects Error in Wonder D2W when populating MS SQL Server example
  • Next by thread: Re: WebObjects Error in Wonder D2W when populating MS SQL Server example
  • Index(es):
    • Date
    • Thread