OpenJPA & MSSQL: executing stored procedures

2007-09-17 Thread Sergey Elin
Hi, I just found strange behavior while executing Query q=entityManager.createNativeQuery( "execute spTree_getSpecs_v2 @p_PARTY_ID=?1," + " @p_GRANT=?2, @p_GROUP_ID=?3, @p_BRAND_ID=?4, @p_VENDOR_ID=?5, " + "@p_ORDER=?6, @p_BEGIN=?7, @p_END=?

Persistent entities pass as params to JPQL queries MUST be attached? Query.getSingleResult() bug or expected behavior?

2007-09-17 Thread frankca
Hi, I have simple query with Foo and FooType are persistent classes and name is string type: (1)@NamedQuery( (2)name = "Foo.findByTypeAndName", (3)query = "SELECT e " + (4)"FROM Foo e " + (5)"WHERE e.fooType = :fooType " + (6) "

Re: Does anyone meet the conflict values in version column?

2007-09-17 Thread Gene Woo
Hi, I have no idea about that "manually setting the version field in your application". So far, my understanding on setting of the version field is a qualified field(Integer, Long or DateType) with annotation @Version. Is this the one you mentioned as manually setting? Thanks, Gene. On 9/18/07

Error while iterating 10,000+ rows

2007-09-17 Thread Diaz Lara JuanManuel
The error is send afte 2,000 rows iterated when using OpenJPA + Derby Client Driver, but it works ok when using TopLink + Derby Client Driver, same driver same server: [java] 45360 JPADependencias2 TRACE [main] openjpa.jdbc.SQL - [0 ms] spent [java] 45360 JPADependencias2 TR

Re: Flush Mode

2007-09-17 Thread Gurkan Erdogdu
Ok. Thanks all. I understand the concept now. - Original Message From: Craig L Russell <[EMAIL PROTECTED]> To: users@openjpa.apache.org Sent: Monday, September 17, 2007 7:47:38 PM Subject: Re: Flush Mode Hi Gurkan, JPA is designed to provide transaction isolation between EntityManage

Re: using OpenJPA with eclipse RCP plugin

2007-09-17 Thread sudhakar
Positive. The DAO classes and the persistence.xml are all packaged in a jar file. I can use these DAO classes to query the database from a a desktop Java application which has a dependency on this jar. The issue is when I attempt to use the same jar as an eclipse plugin and call the query methods.

Re: using OpenJPA with eclipse RCP plugin

2007-09-17 Thread Patrick Linskey
Are you sure that the jar contains the right file at META-INF/persistence.xml? -Patrick On 9/17/07, sudhakar <[EMAIL PROTECTED]> wrote: > I realize this is more of an eclipse related question. But was hoping > someone here has already tackled this. > > I have some DAO classes that user OpenJPA. T

using OpenJPA with eclipse RCP plugin

2007-09-17 Thread sudhakar
I realize this is more of an eclipse related question. But was hoping someone here has already tackled this. I have some DAO classes that user OpenJPA. This is packaged as a jar and I can use the jar in a regular Java application to connect and query the database. I then created an Eclipse RCP plu

Re: Flush Mode

2007-09-17 Thread Patrick Linskey
Hi, If SessionOperations is creating a new EM, then what you're seeing is the expected behavior -- different EMs in an SE environment will always use different JDBC connections, and so the transactions are isolated from each other. Assuming that your database is not using a READ_UNCOMMITTED isolat

Re: Flush Mode

2007-09-17 Thread Craig L Russell
Hi Gurkan, JPA is designed to provide transaction isolation between EntityManagers. So, if two EntityManagers do not share the same transaction, changes made in one must not be visible in the other. In your case, the query from the second EntityManager should not be able to see the change

Re: Does anyone meet the conflict values in version column?

2007-09-17 Thread Patrick Linskey
Hi, Are you manually setting the version field in your application? -Patrick On 9/17/07, Gene Woo <[EMAIL PROTECTED]> wrote: > Hi, > > I got the following error messages from application server. I am very > confused on that. Because this is an isolated entity without any > relationship to the re

Re: Flush Mode

2007-09-17 Thread Gurkan Erdogdu
public void method1 (){ EntityManager m = null; String result = null; EntityTransaction transaction = null; try{ m = SessionOperations.getEntityManager(); transaction = SessionOperations.getTransaction(m); transaction.

Re: Flush Mode

2007-09-17 Thread Patrick Linskey
Can you post the actual code plus your persistence.xml file please? -Patrick On 9/17/07, Gurkan Erdogdu <[EMAIL PROTECTED]> wrote: > Hi; > > When I change User status in method1 using flush, it does not sync with the > database. It still looks the same status value in other method. > > public vo

Flush Mode

2007-09-17 Thread Gurkan Erdogdu
Hi; When I change User status in method1 using flush, it does not sync with the database. It still looks the same status value in other method. public void method1(){ EntityManager m; EntityTransaction t; m.setFLushMode(AUTO); t = m.gettransaction(); t.begin; Query q = some query to get User

Does anyone meet the conflict values in version column?

2007-09-17 Thread Gene Woo
Hi, I got the following error messages from application server. I am very confused on that. Because this is an isolated entity without any relationship to the rest of entities. <4|true|0.9.7> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "event.update_version" to two

Re: flush(): memory & performanc

2007-09-17 Thread Christiaan
Patrick Linskey-2 wrote: > > What happens if you call evict() on the objects that should be made > hollow? > Unfortunately not (from what I can see in my debugger). I think this is also according to the manual, since evicts only transitions non-dirty objects to hollow. And as described by the

Re: OpenJPA 0.9.7 and empbedded websphere MSSQL driver: bug?

2007-09-17 Thread Sergey Elin
Actually I'm not sure that the problem is limited to SQLServer only. Anyway this fix can be moved to AbstractSQLServerDictonary.setNull() I think. Here is the patch (tested, works fine for me): --- AbstractSQLServerDictionary.java.orig 2007-09-17 11:11: 59.0 +0400 +++ AbstractSQLServ

Re: OpenJPA 0.9.7 and empbedded websphere MSSQL driver: bug?

2007-09-17 Thread Patrick Linskey
Hi, What about if you override the setNull() method in SQLServerDictionary to convert OTHER to VARCHAR? I generally prefer that approach, since it isolates things to SQLServer a bit more, but on the other hand, setNull() is called from a number of places. I wonder if it's ever called with Types.O

Re: Sick of Toplink, Moving too OpenJPA

2007-09-17 Thread Patrick Linskey
Hi, What happens if you list your persistent types in the persistence.xml file? OpenJPA has directory-scanning capabilities, but let's start simple and just list them out. (FWIW, the JPA spec says that when using JPA outside a container, classes must be listed.) -Patrick On 9/16/07, Ballist1c <