Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange behaviour on ejbCreate

0 views
Skip to first unread message

Ruth Marie

unread,
Aug 27, 2002, 1:11:56 PM8/27/02
to
Hi!

I am currently using the 5.0.2 release of the Borland appserver for
Windows (2000SP2) and have come across a problem I'm not able to
solve.

I have an entity, let's call it Customer, which consists of (surprise,
surprise) a primary key and then some fields - of which one is a
foreign keys.

Let's just put up an example entity (its just an example, so don't
flame it! :)to make it easier to understand what I mean:

Customer
--------
int ID - PK
string name
string adress
string customerType - FK

Let's say we want to insert values (10, 'John Doe, 'John Doe Avenue',
'Normal') into this entity. What the application server tries to do on
a Customer.create is (by reading the sql log) to:

1. insert everything into the db EXCEPT the foreignkey(s). (insert
into Customer values (10,'John Doe', 'John Doe Avenue', '');

2. Then it, for some reason I still do not understand, do a "select *
from Customer where customerType = 'Normal';".
Then it, it seems, processes this data so that my transaction actually
is timed out. (There are a lot of customers that are of the
'Normal'-type).

3. Then it WOULD, if we had chosen 'Abnormal' type (which only 2 other
Customers has set as type) do and update to the customer to set the
type to 'Abnormal', but in this case it times out before that.
(Timeout value is 20 seconds, which is A LOT more than it should take
to insert a simple row in a table).

So my questions are: Why does it do this, and how can I stop it from
doing things this way? That sql-select and the assumed processing of
the data it gets in #2 takes way too long!!

HELP!!

With regards,

Ruth Marie

0 new messages