• 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
Entity With Compound PK And CLOB Field
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Entity With Compound PK And CLOB Field


  • Subject: Entity With Compound PK And CLOB Field
  • From: Michael Hast <email@hidden>
  • Date: Tue, 24 May 2011 20:43:56 -0700

Hi:

We had an interesting problem today. We have an entity called ReviewerData which has a personId and fiscalYear compound primary key. It also has 3 more attributes, a CLOB field, a varchar2(4000) and an Integer attribute. All attributes except the CLOB are marked as a locking attribute (see attached image).

When we are updating the CLOB field and any of the other 2 attributes and call EC saveChanges, we are getting the error:

Expected a LOB count of 0 but could not fetch that many objects.

The issues is that there are 2 SQL statements being generated by the Oracle plugin within 1 transaction:

UPDATE REVIEWER_DATA SET HAS_DONE_EXTERNAL_REVIEW = ?, REVIEW_QUALIFICATIONS = EMPTY_CLOB() WHERE (PERSON_ID = ? AND FISCAL_YEAR = ? AND DESCRIPTION_OF_WORK = ? AND HAS_DONE_EXTERNAL_REVIEW = ?) withBindings: 1:0, 2:97208, 3:2012, 4:"ABC", 5:1

SELECT t0.REVIEW_QUALIFICATIONS FROM REVIEWER_DATA t0 WHERE (t0.PERSON_ID = ? AND t0.FISCAL_YEAR = ? AND t0.DESCRIPTION_OF_WORK = ? AND t0.HAS_DONE_EXTERNAL_REVIEW = ?) FOR UPDATE withBindings: 1:97208, 2:2012, 3:"ABC", 4:1

The SELECT statement fails, causing the error above. If I don't have a compound PK, only have a single PK attribute (personId), the SELECT statement only has one column in the where clause and all works great:

SELECT t0.REVIEW_QUALIFICATIONS FROM REVIEWER_DATA t0 WHERE (t0.PERSON_ID = ?) FOR UPDATE withBindings: 1:97208

I believe there is a bug in how the SQL is being generated. In the where clause it should only use the 2 PK attributes rather than all the lock attributes.

My question is how can I fix this? Is it the Oracle plugin? Wonder has an Oracle plugin, should I try that out first?

Michael.
--
Tel: (602) 279-4600 ext: 635
Desert Sky Software: www.desertsky.com
    Specializing in the Development and Hosting of
    e-Business Applications.

Attachment: Entity.png
Description: PNG image

 _______________________________________________
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

  • Follow-Ups:
    • Re: Entity With Compound PK And CLOB Field
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Using DataGrid in WO
  • Next by Date: Re: Entity With Compound PK And CLOB Field
  • Previous by thread: Re: Time profiling
  • Next by thread: Re: Entity With Compound PK And CLOB Field
  • Index(es):
    • Date
    • Thread