Bugs item #850859, was opened at 2003-11-28 17:34
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=850859&group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Sandro Santos Andrade (sandros)
Assigned to: Nobody/Anonymous (nobody)
Summary: CMP-Engine changing primary-key field value ???

Initial Comment:

Hi all,

I have two entities 'SystemUser' (primary key 'login')
and 'Author', where author's primary-key is composed by
an foreign-key to systemuser's primary-key and a string
field fullName.
I create in author a field that is both cmp-field and
cmr-field and did all relationship configurations.
All table were successfully created with primary-key
and foreign-key constraints (PostgreSQL):

Table "public.systemuser"
Column | Type | Modifiers
----------+------+-----------
login | text | not null
fullname | text | not null
password | text | not null
Indexes: pk_systemuser primary key btree (login)

Table "public.author"
Column | Type | Modifiers
----------+------+-----------
login | text | not null
fullname | text | not null
name | text | not null
address | text | not null
Indexes: pk_author primary key btree (login, fullname)
Foreign Key constraints: fk_author_login FOREIGN KEY
(login) REFERENCES systemuser(login) ON UPDATE NO
ACTION ON DELETE NO ACTION

But, the accessor setLogin(x), where x is the
LocalInterface for systemuser with primary-key =
'sandros', in entity Author throws the following error:
"Could not create entity:java.sql.SQLException: ERROR:
fk_author_login referential integrity violation - key
referenced from author not found in systemuser", but
record 'sandros' exists in systemuser table.

If I delete the constraint fk_author_login in table
author, the record inserted is:

login | fullname | name | address
--------------------------+-----------------------+----------------+---------
local/SystemUser:sandros | Sandro Santos Andrade |
Andrade, S. S. | UFBa

That is, the systemuser's primary key (login) is being
'local/SystemUser:sandros' rather than just 'sandros'

If the cmr-field login is not part of primary key the
insert occurs all right.

Any idea ? I'm using jboss 3.2.2rc2, jdk 1.4.2 in
Debian kernel 2.4.18 and postgresql 7.3.4.

Thanks in advance,

Sandro


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=850859&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to