Re: adding data visibility / ownership restrictions to query

2007-12-12 Thread plinskey
>From a JPA standpoint, you'll need to either pass along the credential info (or use a ThreadLical or some sort of context-specific state), or use the underlying capabilities of your database to do per-user authentication. For example, Oracle's OCI driver allows communication of user authorization

Re: Custom data types

2007-12-04 Thread plinskey
Hi, I think that you should be using the regular Java type name; are there really underscores and no package in the class ne? You can always specify a strategy for a particular field with the @Strategy annotation as well. -Patrick On 12/3/07, Roy Smith <[EMAIL PROTECTED]> wrote: > Thanks for th

Re: Entity methods which call Setters are not working

2007-12-03 Thread plinskey
Sounds like a bug to me. If you could create a test case and attach it to a new JIRA issue, that'd be great. -Patrick On 12/3/07, Marc Siegel <[EMAIL PROTECTED]> wrote: > Hi, > > 1. The subclasses have additional attributes, but do not modify these at > all. > 2. The mapped superclasses are enh

Re: OptimisticException question

2007-12-03 Thread plinskey
Hi, That's a bug; OpenJPA is not translating exceptions thrown during JTA-managed commits. Can you open a JIRA issue for it? -Patrick On 11/30/07, Ajay Aggarwal <[EMAIL PROTECTED]> wrote: > Patrick, > > Here is the full stack trace. > > -Ajay > > occurred during commit of transaction Name=[

Re: EntityExistsException

2007-12-03 Thread plinskey
Hi, The posted stack trace looks fine to me. The duplicate record is being detected while writing to the database during commit, and this is causing the tx to fail, hence the RollbackException. If you changed your test to load all the Messages into memory in the tx before calling persist() then y

Re: How do I distinguish different types of exceptions in openjpa

2007-12-03 Thread plinskey
... Unless your db has deferred constraints or uses optimistic locking internally to maintain db locks, in which case the flushed tx may still a fail. -Patrick On 12/2/07, Craig L Russell <[EMAIL PROTECTED]> wrote: > Hi Gul, > > If you execute a JPA method, the JPA exception thrown should be able

Re: cant modify result list running with enhance

2007-12-03 Thread plinskey
Hi, I guess I don't totally understand the use case. Why do you want to add a record to the result list? Semantically, the result list is the list of all instances that match the query; adding an instance to the query result list seems like it erodes this semantic meaning. I am not surprised that

Re: Entity methods which call Setters are not working

2007-12-03 Thread plinskey
Hi, What do the subclasses look like? Do they have setIsChanged() or setSynchronizedAt() overridden definitions? Are the mapped superclasses enhanced? -Patrick On 11/30/07, Marc Siegel <[EMAIL PROTECTED]> wrote: > Hi Folks, > > I've noticed a certain bug that appears in some, but all of the cas

Re: Custom data types

2007-12-03 Thread plinskey
Hi, I think ValueHandler will be the way to go. This will let you use the new type as a field, as a member of a list, and as a key or value in a map. Additionally, you'll be able to use instances of the new type in queries. There is a sample ValueHandler for Points that should map well to your n

Re: Bulk Update

2007-12-03 Thread plinskey
Hi, A couple of guesses: - have you already modified anything in the transaction before calling executeUpdate()? This could trigger OpenJPA to do the update in memory in some situations, which would explain the SELECT. - I think that the sadly-unlocalized message is caused by your attempt to upd

Re: OptimisticException question

2007-11-30 Thread plinskey
Hi, Do you have the full exception stack? That's just the outer exception. -Patrick On 11/29/07, Ajay Aggarwal <[EMAIL PROTECTED]> wrote: > Well, I am seeing OptimisticException and not OptimisticLockException. > What's the difference between the two? Below is my trace, if that's any > hint as t

Re: How do I distinguish different types of exceptions in openjpa

2007-11-30 Thread plinskey
Yes; often, there will be a nested exception available from Exception.getCause(). -Patrick On 11/29/07, Gul Onural <[EMAIL PROTECTED]> wrote: > > When a database error occurs in the openjpa, I always get rollback > exception. For example if there is an error > because of a duplicate record creati

Re: cant modify result list running with enhance

2007-11-29 Thread plinskey
Hi, What do you mean by this?Are you saying that you can't insert or delete records in the list, or that you can't modify entries in the list? I would expect the former regardless of using the enhancer. -Patrick On 11/29/07, Sebastian Souza <[EMAIL PROTECTED]> wrote: > > I cant modify any result

Re: OptimisticException question

2007-11-28 Thread plinskey
Hi, The internal exception should be re-wrapped in an OptimisticLockException. -Patrick On 11/28/07, Adam Hardy <[EMAIL PROTECTED]> wrote: > Ajay Aggarwal on 28/11/07 17:00, wrote: > > Hi, > > > > > > > > I wanted to know why openJPA uses > > "org.apache.openjpa.util.OptimisticException" and not

Re: schema property is not used in the latest build?

2007-11-27 Thread plinskey
Hi, I think that I made that change as part of the changes to handle serialization of EntityManagers. However, issues with BrokerFactory caching based on full properties, so I switched to just use the configuration's id. So, it's probably fine to just revert that one change. -Patrick On 11/27/07

Re: BigInteger and BigDecimal as Primary Key

2007-11-25 Thread plinskey
Hi, If the fix is checked into the 1.0.x branch already (check the svn commit data in the jira issue), then the 1.0.2 snapshot build should have the feature. -Patrick On 11/25/07, klaasjan elzinga <[EMAIL PROTECTED]> wrote: > Judging from the jira comments you will have to wait for 1.0.2. The >

Re: How to do 0 or 1 relationship annotation ?

2007-11-25 Thread plinskey
Hi, What you're looking for is a unidirectional one-to-one. Can you post the source code for the second case in your email? -Patrick On 11/21/07, Gul Onural <[EMAIL PROTECTED]> wrote: > > > I have a classA which has a one-to-one relationship to classB. The > classB side of the relationship is re

Re: org.apache.openjpa.util.GeneralException: null at org.apache.openjpa.kernel.BrokerImpl.embed(BrokerImpl.java:2645)

2007-11-24 Thread plinskey
Yes, only things marked @embeddable can be put into @Embedded fields. As Craig points out, this is certainly a candidate for a better test case. -Patrick On 11/24/07, Sebastian Souza <[EMAIL PROTECTED]> wrote: > > I found a solution to my problem > > my embedded field was a type Data (a mapped s

Re: Problem with OpenJPA Enhancer on Tomcat 6

2007-11-24 Thread plinskey
Hi, To run the enhancer via ant, you need to have the classes available in the classpath used when the ant task is run. How are you invoking the ant task? -Patrick On 11/24/07, gutostraube <[EMAIL PROTECTED]> wrote: > > Hi all! > > Every time I start the server the following message appears on t

Re: Re[2]: java.lang.IndexOutOfBoundsException when commit long transaction

2007-11-23 Thread plinskey
Ah. Are you attempting to persist new instances with null blob values? -Patrick On 11/22/07, Luc1fer Hell <[EMAIL PROTECTED]> wrote: > If i post the SQL), it would be about 30 mb). > I think i found cause of problem in Postgre log file. > It starts with: > 2007-11-22 16:27:58 ERROR: null value i

Re: java.lang.IndexOutOfBoundsException when commit long transaction

2007-11-22 Thread plinskey
Hi, Can you post the SQL that caused this? You can turn this on by setting the openjpa.Log property to SQL=TRACE. -Patrick On 11/22/07, Luc1fer Hell <[EMAIL PROTECTED]> wrote: > Hello. > > I'm trying to implement data replication mechanism base on OpenJPA and > WebServices. > I almost solve the

Re: how to avoid large number of queries?

2007-11-16 Thread plinskey
Hi, It sounds like your relations are lazy (the default for collections and maps). What happens if you change them to be eager? -Patrick On 11/16/07, Nick Johnson <[EMAIL PROTECTED]> wrote: > Just a thought here... is OpenJPA using this strategy because it's > optimized to hope that objects will

Re: Obtaining a JDBC connection from JPA

2007-11-16 Thread plinskey
If you are using JTA, your tx manager will take care of this for you. That's the only spec-compliant way right now. I'm sure that any decent implementation will have an apo for this, so you might consider creating a class that you call to prform this and other common extensions in a single locatio

Re: setting up transactions

2007-11-13 Thread plinskey
They're both part of the JTA spec. -Patrick On 11/13/07, Adam Hardy <[EMAIL PROTECTED]> wrote: > Patrick Linskey on 10/11/07 21:15, wrote: > > Hi, > > > >> if openjpa.TransactionMode=local, we have to deal with the transactions > in the > >> data access layer. But this is not what I want to do -

Re: SQL select when merging detached entity

2007-09-18 Thread plinskey
Hi, There are some cases where we know an obj is detached, and optimize away the SELECT. I don't remember the exact cases right now, and don't have access to the docs, so this is probably only of limited assistance. It'd be good to know more about your domain model, though. -Patrick On 9/18/07,

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

2007-09-18 Thread plinskey
Regarding q2: em.merge() should do the trick. Also, IIRC, your case 1 should always fail; maybe we should make it throw instead since that's a pretty convoluted way to always return no results. -Patrick On 9/17/07, frankca <[EMAIL PROTECTED]> wrote: > > Hi, > > I have simple query with Foo and F

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

2007-09-18 Thread plinskey
Hi, Yes, they must be managed instances. When using a persistent type in a query, you are either doing object equality (in which case we must have a managed instance to understand how to handle object identity) or you are accessing persistent fields (in which case we must be hooked into the object

Re: Error while iterating 10,000+ rows

2007-09-18 Thread plinskey
Hi, Can you post the full stack, including the nested exceptions? -Patrick On 9/17/07, Diaz Lara JuanManuel <[EMAIL PROTECTED]> wrote: > 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

Re: 1.0.0 The type "class" has not been enhanced.

2007-08-30 Thread plinskey
Yep, it's some sort of a classloader issue. Somehow, PersitenceCapable is available in two different classloaders. I'll know more later today / tomorrow. -Patrick On 8/30/07, ben short <[EMAIL PROTECTED]> wrote: > My test apps not rocket science so feel free to make a test case for > it. But coul

Re: Different EntityManagerFactories, One datastore

2007-08-23 Thread plinskey
Yes. Do you want the different EMFs to point to the same tables? If so, and if you use data caching, OpenJPA will properly handle intra-JVM cache invalidation. -Patrick On 8/22/07, Gavin Bong <[EMAIL PROTECTED]> wrote: > Hi, > > Is it possible to have multiple EntityManagerFactories to point to t