db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vogt <Thomas.V...@TVCS.de>
Subject OJB Foreign Key Problem in Persistence Broker (MySQL InnoDB)
Date Wed, 28 Jul 2004 08:04:51 GMT
Hi

I'm using the Persistence Broker to access the data in an MySQL InnoDB
Database, when the Primary Key is not in the same order as the foreign
ky constraint is, OJB seems to erranously mix it up and tries the wrong
way round, this way it won't find a result.

OJB only does so in foreign keys, when the object itself is searched
directly, it is found without any problem.

I tried to solve the problem on my own, but i did not find the
problematic part in the source, so could someone with more detail
knowledge try to identify and fix the problem ?

/I also made an entry in the BugDB Ticket OJB282./

Thanks

Thomas

DATABASE DEFINITION EXTRACT

.....
  PRIMARY KEY(Gruppennummer, Projektnummer, Quartal),
  INDEX Ergebnissdaten_Integer_FKIndex2(Projektnummer, Gruppennummer),
  FOREIGN KEY(Projektnummer, Gruppennummer)
  REFERENCES Projektgruppen(Projektnummer, Gruppennummer)
......

CONTENTS EXTRACT

Gruppennummer, Projektnummer
1, 1
1, 1
3, 1
2, 2


DEBUG LOG EXTRACT
......
core.PersistenceBrokerImpl - Creating RsIterator for class
[org.fhw.cabaweb.ojb.dataobjects.Projektgruppen]

accesslayer.JdbcAccessImpl - executeQuery : QueryByCriteria from class
org.fhw.cabaweb.ojb.dataobjects.Projektgruppen  where *[[gruppennummer =
1, projektnummer = 3]]*

sql.SqlGeneratorDefaultImpl - SQL:SELECT
A0.Aktiv,A0.Gruppennummer,A0.Gruppenname,A0.Projektnummer FROM
Projektgruppen A0 WHERE (A0.Gruppennummer = ?) AND A0.Projektnummer = ?

accesslayer.JdbcAccessImpl - executeQuery:
com.mysql.jdbc.PreparedStatement@7db937: SELECT
A0.Aktiv,A0.Gruppennummer,A0.Gruppenname,A0.Projektnummer FROM
Projektgruppen A0 WHERE *(A0.Gruppennummer = 1) AND A0.Projektnummer = 3*

accesslayer.RsIterator -
RsIterator[org.apache.ojb.broker.accesslayer.RsQueryObject[query:
QueryByCriteria from class
org.fhw.cabaweb.ojb.dataobjects.Projektgruppen  where [[gruppennummer =
1, projektnummer = 3]], class descriptor:
org.fhw.cabaweb.ojb.dataobjects.Projektgruppen]] initialized
......




---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message