dcsimg
Select after update or insert
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raul_Hurtado
Posted On:   Monday, July 22, 2002 02:44 PM

In my business method in a Session EJB I need: 1.- Make a complex select (using select max(field) for instance) 2.- Update or insert into a table using a finder or create method of an Entity EJB 3.- Make a complex select (using select min(field) for instance) 4.- Update or insert into a table using a finder or create method of an Entity EJB All this select, insert an update use the same table and therefore the same Entity EJB. All this must form together a single transaction Question A ---------- I use a 'Conection' to the Server Pool for executing the 'complex select', due to is n   More>>

In my business method in a Session EJB I need:



1.- Make a complex select (using select max(field) for instance)



2.- Update or insert into a table using a finder or create method of an Entity EJB



3.- Make a complex select (using select min(field) for instance)



4.- Update or insert into a table using a finder or create method of an Entity EJB



All this select, insert an update use the same table and therefore the same Entity EJB.



All this must form together a single transaction



Question A

----------

I use a 'Conection' to the Server Pool for executing the 'complex select', due to is not possible make this select though a finder. Am I right?



Question B

----------

When I uptate de table in step 2, why if I ask for the data updated in step 3 I can not see the fields updated in step 2? The queryes inside the transaction can see the data updated, inserted an deleted that have been made before in the same transaction, can't they?




Question C

----------

When I insert (and not when I updated) I can't execute the query in step 3; it is due to the table (all rows) are locked. However, the finder method of the Entity EJB give me results. (I use MS SQL Server 2000 and Webogic Server 6.1 service pack 1) What is hapenning?



Thanks,

Raul Hurtado

   <<Less
About | Sitemap | Contact