cancel
Showing results for 
Search instead for 
Did you mean: 

database not getting updated with Transaction Required attribute

Former Member
0 Kudos

Hello:

I have an entity bean called EntityTest with primary key Long type. It is bean managed persistence with 2 more fields str1 (default initial value str1)and str2 (initial value str2) of String type. I'm using an oracle datasource to communicate with the database.

I have a session bean that talks to the Entity beans. the method updateEntityBeans dows the following:

public void updateEntityBean (long id){

EntityTest et = createEntityBean(id);

et.setStr1("str1str1");

et.setStr2("str222222");

}

For the above operation, I could see that the ejbStore called 3 times for one call of updateEntityBean of the session bean:

id str1 str2

-


1 str1 str2 (as part of ejbCreate)

1 str1str1 str2 (as part of call et.setStr1("str1str1")

1 str1str1 str222222 ( as part of call et.setSrt2("str222222")

When the container transaction type of the entity bean is left to default( no configuration done on the entity bean) then aftre the call the bean value in the database is

id = 1, str1 = str1str1 and str2 = str222222

but if the container transaction attribute is set to Required, then the ejbStore is called 3 times again, but the final value of the database is

is=1, str1=str1 and str2=str2

Not sure why the database is not updated when the transaction attribute is required. Could someone give me some pointers.

Thanks for your time.

I'm using SAP Netweaver 2004s JAVA SP9 eval version.

Thanks,

Ravi

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Could someone give me some pointers.

Thanks,

Ravi