Empty Reference FK overwrites primary key ?

2004-04-07 Thread sschloesser

Hi,

I' ve got a simple object with mandant, id as primary key. As such I can insert it 
into the database.
If I now define a relation to another object using a foreign key my insert fails with 
primary key missing.
This is due to the fact that the Relation Object is null, i.e. the relation is not 
defined for this object.

I do not understand why ojb "overwrites" my primary key (mandant) from the missing 
relation ? I am using ojb rc5 and SAPDB.

Thanks for any ideas,

Stefan

E.g.

create table Adresse(
  mandant VARCHAR(3) not null,
  id FIXED(32) not null,
   plz VARCHAR(200),
 fk_person FIXED(32),
 primary key (mandant, id)
);
create table Person(
  mandant VARCHAR(3) not null,
  id FIXED(32) not null,
   name VARCHAR(200),
 primary key (mandant, id)
);








   



   

The sql generated looks like this:
INSERT INTO Adresse (mandant,ID,plz,fk_person) VALUES ('','1','761','0')




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Logging SQL for automatic index generation or performance Analysation ?

2004-03-03 Thread sschloesser
Hi,

I would like to know where the best place would be to hook into ojb a class
which logs all sql statements sent to the DB.

My idea is to analyze the from and where clause and log into a database
table the actual statements used in a live system. I then would like to
write a tool which analyzes this table and suggests the "best" indices to
create on the database.

To make sure I really catch all statements I would like to directly hook
into ojb. Also, this could then easily be re-used.

We thought about a trace but the amount of data just seems to big.

Any ideas / suggestions ?

Thanks,
  Stefan Schlösser


-

I N T E R M E D I A T E GmbH & Co. KG
eSolutions & Integration

Durmersheimer Straße 55 t +49 (0)721.98644-50
76185 Karlsruhe f +49 (0)721.98644-99
http://www.intermediate.de

P.S. Als Beratungs- und Systemhaus optimiert Intermediate die
Geschäftsprozesse mittelständischer Unternehmen in Vertrieb,
Marketing und Kundenservice.
Tätigkeitsschwerpunkte sind Angebots- und Produkt-Konfiguration
sowie Enterprise Content-Management-Systeme.
Unsere besondere Stärke liegt in der Integration bestehender
Systeme, insbesondere von ERP-Systemen wie SAP R/3, BRAIN AS,
MAS90 etc.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Trailing space / blank in Varchar String lost during write !?

2003-06-24 Thread sschloesser
Hi,

I have an Object stored in a SAPDB with a Varchar field mapped to a String.

i.e..
private String text;

 

The String may have trailing spaces which must not be lost. These trailing
space are however somehow lost during the write.
This change does not become immediately apparent. As long as the program is
running, repeated retrieval will retrieve correct
values including the trailing spaces ( I am using the Object cache).
Restart of the VM will result in the trailing spaces being
lost.

A look on the SAPDB reveals that the trailing spaces are not written.

Using a test table yields that the jdbc driver is working fine and is able
to retrieve trailing spaces as well as a single blank,  which also is valid
content for my text.

What to do ?

Cheers,
  Stefan







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]