Marko Novakovic

+ Follow
since Jul 13, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marko Novakovic

Actually, i have one interface that is annotated with @Local

I would like to have more Session Beans that are implementing that interface. ?

I have interface GetData. I would like to have multiple implementations of that interface so that i can choose what kind of GetData will i use. This is @Local Interface and various implementations are called from another Session Bean. How can switch between implementations?

I have added @Stateless(name="serviceXXX") and am using it in that way but no matter what i set to name when using it, i am always getting the same implementation !?
Hi, you say i am not using Extended EntityManager? Can you tell me what do you mean by it?

Do you mean Extended scope of session bean?

cheers, mn
If you use Hibernate as JPA provider you can use property show_sql and it will print it in console in PreparedStatement format (with those ?)

Maybe other providers have similar feature.

I have one session bean that is calling few other session beans. If i call EntityManager.persist(myObject) within first session bean (called from servlet), i can see in APPServer's console Hibernate's INSERT statement.

If i stop application server at this point, i can't see this record inserted in database. After that persist, i am calling other session bean with saved entity as argument. When i call manager.refresh(myObject) i get EntityNotManaged exception...

What can be the problem? I guess something with transactions, but had anyone had those problems?

I am using GlassFish V2 with hibernate as JPA provider
[ July 13, 2008: Message edited by: Marko Novakovic ]
Of course it can be used.

Only you cannot use Criteria API and Session. At least i didn't manage to get it from EntityManager.getDelegate()

Here is part of my persistence.xml file..

<persistence-unit name="StockEmuTest-ejbPU" transaction-type="JTA">
<property name="" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>