Hi,
Normally in our application we are using entity bean for all the database operation. but due to some restriction in one module we are using stored procedure for updation of data instead of doing it by entity bean. we are calling stored procedure from our session which in turn update the data in the database in multiple rows and multiple tables. now the problem is that wheather this situation will take care of transcation part?? i mean while updatation of data by stored procedure if any entity bean already loaded how can we ensure that entity bean gets the updated data?
Kindly Help.
Thanks and Regards,
Akil
-
Can I call a stored procedure from session bean?? (5 messages)
- Posted by: Akil Saleh
- Posted on: April 11 2002 12:42 EDT
Threaded Messages (5)
- Can I call a stored procedure from session bean?? by Saruman White on April 11 2002 15:19 EDT
- Can I call a stored procedure from session bean?? by Akil Saleh on April 12 2002 12:37 EDT
- Can I call a stored procedure from session bean?? by sfiap freelance on April 11 2002 16:02 EDT
- Can I call a stored procedure from session bean?? by David Jones on April 11 2002 16:50 EDT
- Can I call a stored procedure from session bean?? by Neeraj Nargund on April 11 2002 17:06 EDT
-
Can I call a stored procedure from session bean??[ Go to top ]
- Posted by: Saruman White
- Posted on: April 11 2002 15:19 EDT
- in response to Akil Saleh
Sorry, that's impossible: entity beans are not aware of changes made behind their backs. They will dutifully keep the state they've read from the database. Actually it depends on container implementation: the advanced containers will not go to the DB just to check, less advanced might do that. -
Can I call a stored procedure from session bean??[ Go to top ]
- Posted by: Akil Saleh
- Posted on: April 12 2002 12:37 EDT
- in response to Saruman White
We are using JRun3.1 as application server. tell me how can we handle the transaction in this case??
please help
Thanks and Regards,
Akil -
Can I call a stored procedure from session bean??[ Go to top ]
- Posted by: sfiap freelance
- Posted on: April 11 2002 16:02 EDT
- in response to Akil Saleh
That will depend upon the transaction isolation attribute and whether entity bean methods are in transaction. When not in transaction (depending upon your trans-attribute in ejb-far), the get and set method will not refresh/write from/to database. Only when the method is called within a transaction scope will it result in database read/write. Using transaction isolation level of "READ COMMITED" or more strigent will solve your issue. Your application Server may or may/not provide the ability to set transaction isolation level. -
Can I call a stored procedure from session bean??[ Go to top ]
- Posted by: David Jones
- Posted on: April 11 2002 16:50 EDT
- in response to Akil Saleh
Hi,
A lot of app servers have a setting to indicate if the database is shared. If you set this then at the start of each transaction the Entity Bean will be reloaded from the database,
David -
Can I call a stored procedure from session bean??[ Go to top ]
- Posted by: Neeraj Nargund
- Posted on: April 11 2002 17:06 EDT
- in response to David Jones
If u set db is shared property to true then this will lead to a lot of ejbLoad() calls and thus so many hits to DB which makes me cringe..... a bit.