In 1) every function seems to run as an atomic operation,(with the database queries either nested in begin-end blocks,or by themeselfs if they are the only transaction in the function.

In 2) strangely for the first connection it begins, sets the transaction isolation level, and the *rollbacks*.Afterwards, for every function, jboss starts with issuing a begin,which unfortunately never ends, and postgresql locks the table.

I have read in the forums, that one should close() the connectionin every home method.

The point is that the code i am playing with is from SUN'sJ2EE tutorial, and it would be great to run in JBoss without,having to modify the code.

Theory says that a commit is done after the end of each method.Any thoughts???

I have 3 BMP entity beans and a postgresql database. I have a simple servlet for creating and editing one of the entities. It seems the beans accept the new values and can be referenced ok, but the data never seems to get written to the database. I added some debug statements and the sql statements are in fact executing...

The part I don't really understand is why my command line test client that does the same thing works fine...

I seem to have solved my problem though. When I implemented the bean, I used the method in the Sun J2EE Developer's Guide of getting a connection in setEntityContext and closing it in unsetEntityContext. After reading about the connection pools more, I decided to try getting the connection immediately before and closing it immediately after I execute the sql. That seems to have fixed the problem with the data not being commited. I'm not sure if this new approach is suitable or not.

Thats what i did myself and worked.Are both your ejbCreate and ejbStore that dont do commit???In my case i got a commit only in ejbCreate but NOT in ejbStore.Note that i also tried the SavingsAccount example from SUN'sJ2EE tutorial (the new one), which also suggests this methodof connection caching.