new-delete-new-find doesn't work
Key: OPENJPA-247
URL: https://issues.apache.org/jira/browse/OPENJPA-247
Project: OpenJPA
Issue Type: Bug
Reporter: Dain Sundstrom
I have a piece of code
^nudge
-dain
On May 24, 2007, at 8:13 PM, Dain Sundstrom wrote:
I have a piece of code that effectively does the same thing the
following test does:
private void newDeleteNew() throws Exception {
beginTx();
// Create new
Person dain = new Person
I have a piece of code that effectively does the same thing the
following test does:
private void newDeleteNew() throws Exception {
beginTx();
// Create new
Person dain = new Person();
dain.setName(dain);
assertFalse(entityManager.contains(dain));
On May 23, 2007, at 7:56 PM, Marc Prud'hommeaux wrote:
I asked a number of times for a security audit to be made of the
security implications of JPA and it was never taken up. Most of
the vendors make extensive use of privileged operations including
getting system properties,
I personally define OpenJPA by the persistence engine and not the
spec it implements. A good persistence engine is very hard to write,
but adapting it to new persistence specs if fairly easy in
comparison. I would like to see the scope be limited to java
persistence with an eye toward
On May 4, 2007, at 10:50 AM, Phill Moran wrote:
Would we then not have to change the overall name from JPA to
openPersistence or
some such?
That would suck. I see no reason we would have to change the
name. It is a choice of the community.
Why not let another project lift out the
Now I'm sorry I sent this email and would like to withdraw my
comments. If the community wants to change the charter or name they
can petition the board later.
I'd like to see the vote continue as is.
-dain
On May 4, 2007, at 10:36 AM, Dain Sundstrom wrote:
I personally define OpenJPA
+1
-dain
On May 3, 2007, at 7:22 AM, Craig L Russell wrote:
This vote is to send the attached draft board resolution to the
incubator for the purpose of graduation from the incubator to the
Apache OpenJPA project.
+1 We're ready; let's graduate
0 Don't care
-1 Let's wait
Establish the
On Apr 26, 2007, at 1:49 PM, David Jencks wrote:
Thanks for all the comments, I've learned a lot.
1. I have a classloader scanning strategy written and apparently
working, however it is rather slow at least in geronimo. Is anyone
interested in it, seeing as how its not an appropriate
On Apr 24, 2007, at 10:35 PM, Patrick Linskey wrote:
Yep -- you've gotta keep it open. If you want to support any JPA impl,
you need to have an EM proxy (please please please make it a dynamic
proxy that implements all the interfaces that the proxied thing
implements).
That code is from my
On Apr 25, 2007, at 10:22 AM, Patrick Linskey wrote:
If I want to have generic code, how am I supposed to
implement the createNamedQuery method? Do I leave the EM
open forever? That doesn't seem right. So when am I
supposed to close the EM?
1. Create an EM proxy. You've already got one, so
Is a query a one time use object? Meaning, I only get to call
getResultList(), getSingleResult(), or executeUpdate() once and then
I have to get a new instance.
Also you stated:
On Apr 24, 2007, at 10:35 PM, Patrick Linskey wrote:
(please please please make it a dynamic
proxy that
24, 2007, at 3:07 PM, Marc Prud'hommeaux wrote:
Dain-
Can you send the embedded exception as well? That should tell us
who closed the query, and it might give us a hint why...
On Apr 24, 2007, at 3:03 PM, Dain Sundstrom wrote:
I have some code that runs outside of a transaction which does
I am they, the one writing the cmp code in OpenEJB.
On first read of the stack trace I thought as you that, I was the one
close the entity manager, but on a second read I notice it was
OpenJPA calling closeIfNoTx that closes the broker.
On Apr 24, 2007, at 7:02 PM, Dain Sundstrom wrote
On Apr 11, 2007, at 7:28 AM, Kevin Sutter wrote:
Okay, I looked at the spec a bit closer and it looks like we need
to allow
for floats as primary keys:
The primary key (or field or property of a composite primary key)
should be
one of the following types:
any Java primitive type; any
On Apr 9, 2007, at 5:44 PM, Craig L Russell wrote:
Hi Dain,
On Apr 9, 2007, at 11:10 AM, Dain Sundstrom wrote:
On Apr 8, 2007, at 1:56 PM, Craig L Russell wrote:
Hi Dain,
I haven't looked in detail at the life cycle of CMP beans in a
couple of years, but in general you can't simply keep
On Apr 9, 2007, at 12:41 PM, Patrick Linskey wrote:
you need an instance. In CMP the assumption is that entity
instances
are expensive to create, so less safe route and you pool them.
Reusing instances is really a CMP problem, but I don't think it can
be implemented without the help of the JPA
On Apr 10, 2007, at 1:24 PM, Craig L Russell wrote:
Hi Dain,
On Apr 10, 2007, at 12:58 PM, Dain Sundstrom wrote:
On Apr 9, 2007, at 5:44 PM, Craig L Russell wrote:
Hi Dain,
On Apr 9, 2007, at 11:10 AM, Dain Sundstrom wrote:
On Apr 8, 2007, at 1:56 PM, Craig L Russell wrote:
Hi Dain
Is it possible to reuse instances from transaction to transaction?
I would like to be able to create a bean in one transaction, detach
it and reattach the same instance in a new transaction. My goal here
is specifically to reuse instances across transactions because they
have a very
recipient,
and have received this message in error, please immediately return
this
by email and then delete it.
-Original Message-
From: Dain Sundstrom [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 08, 2007 12:18 AM
To: open-jpa-dev@incubator.apache.org
Subject: Can I reuse instances
I think I saw this once. The problem is in JPA named queries are all
contained in a single global namespace, so if you have to persistent
beans that define queries with the same name you get a warning. It
would be nice if the warning told you where the duplicate
declarations are located.
I tested the fix and it solved my problem.
Thanks,
-dain
On Apr 2, 2007, at 3:00 PM, Marc Prud'hommeaux wrote:
Dain-
On Apr 2, 2007, at 12:23 PM, Dain Sundstrom wrote:
Is this something we can put in 0.9.7 or has that been cut already?
I've gone ahead and committed the fix
, Dain Sundstrom wrote:
Actually, I think there is a bigger problem... Say I have a
query like this:
SELECT x FROM foo AS x WHERE foo.name = ?2
The org.apache.openjpa.kernel.QueryImpl.assertParameters(...)
code assumes that if I have 1 parameter it is numbered ?1, but in
EJB 2.1
I'm using 0.9.6 on hsqldb and am getting exceptions like this
periodically:
0|false|0.9.6-incubating
org.apache.openjpa.persistence.PersistenceException: Index already
exists: I_BNJBBTB_A1 in statement [CREATE INDEX I_BNJBBTB_A1 ON
BEANEJB_MXM_UNI_BTOB] {stmnt 7870505 CREATE INDEX
are not the intended
recipient,
and have received this message in error, please immediately return
this
by email and then delete it.
-Original Message-
From: Dain Sundstrom [mailto:[EMAIL PROTECTED]
Sent: Monday, April 02, 2007 9:58 AM
To: open-jpa-dev@incubator.apache.org
Subject
I have the following query:
SELECT a.alias FROM AliasBean AS a WHERE (a.alias IS NULL AND ?1 IS
NULL) OR a.alias = ?1
Which works great when run against HSQLDB. When I switch the
database to Derby I get the following exception:
0|false|0.9.6-incubating
On Apr 2, 2007, at 8:06 PM, Craig L Russell wrote:
Hi Dain,
I've seen this problem as well, with a different provider. The JPA
spec lead sez that ?1 IS NULL is not a portable JPAQL query, even
though some providers can generate SQL that some databases can
execute properly.
OpenJPA is
for extra-params flag.
-dain
On Mar 31, 2007, at 8:56 AM, Dain Sundstrom wrote:
I'm working on a CMP 2 implementation that delegates to OpenJPA for
persistence. I'm running into a problem where I get the following
exception:
org.apache.openjpa.persistence.ArgumentException : More parameters
On Mar 22, 2007, at 8:34 AM, Kevin Sutter wrote:
Craig,
I like the idea of putting together a roadmap. I had started this
conversation with Patrick earlier this week, so your timing is
perfect.
Concerning the 0.9.7 release... I would like to shut down the
development
of this release
Not sure if this is relevant, but normally, I use explicit, thread
and then system.
-dain
On Feb 26, 2007, at 10:52 PM, Marc Prud'hommeaux wrote:
How about just assigning cl = ClassLoader.getSystemClassLoader()
(which will hopefully never be null) when cl is null?
On Feb 27, 2007, at
[
https://issues.apache.org/jira/browse/OPENJPA-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475095
]
Dain Sundstrom commented on OPENJPA-158:
+1
With this change I will be able to lower the log level
On Feb 20, 2007, at 1:13 PM, Pinaki Poddar wrote:
It is kind of a pain to unpack a jar, enhance it and repack it.
How about compile, enhance and then jar?
That implies that I'm that own the development cycle of this code.
In this case, I just get a jar from the user.
Can the OpenJPA
I've found that the easiest way to deal with jars is to stream from
the old jar to the new jar. I've found lots of platform problems
with unpack and rejar... especially around the cleanup of the
unpacked dir.
-dain
On Feb 21, 2007, at 10:25 AM, Pinaki Poddar wrote:
That implies that
Can the OpenJPA enhancer operate on a Jar file? It is kind of a pain
to unpack a jar, enhance it and repack it.
-dain
This is killing my productivity. I'm going to try switching to
toplink to see if this is really an OpenJPA problem.
Does anyone know if toplink has an equivalent of the
LifecycleListener in OpenJAP?
-dain
On Feb 15, 2007, at 8:19 PM, Dain Sundstrom wrote:
That didn't help
This is the only group of JPA developers, I know of so I'm going to
ask here...
One thing I find strange is the namespace of NamedQueries. I declare
NamedQueries using either an annotation on my entity or in xml using
a named-query element nested in my entity element. This implies to
On Feb 15, 2007, at 5:19 PM, Lance J. Andersen wrote:
Yes. The best we could do is to make a recommendation that users
guarantee uniqueness of names by prepending the entity name to the
query name.
This is exactly what Mike Keith recommends in his book Pro EJB 3
Java Persistence API
Do
?
On Dec 31, 2006, at 12:28 PM, Dain Sundstrom wrote:
On Dec 31, 2006, at 12:04 AM, Marc Prud'hommeaux wrote:
I've never experienced this problem, but as a guess, are you
running with dynamic enhancement (using the -javaagent
flag)? If
so, what happens if you enhance manually
On Feb 13, 2007, at 5:27 AM, robert burrell donkin wrote:
On 2/13/07, Geir Magnusson Jr. [EMAIL PROTECTED] wrote:
Pointing people at the page is good, but doesn't solve the problem.
i was a little confused about which problem you needed to solve :-)
I think I want to make the list
this problem and reported it at:
https://issues.apache.org/jira/browse/OPENJPA-142
The only workaround is to add the @Entity(name=someAlias)
annotation to the class in addition to specifying it in the orm.xml
file.
On Feb 12, 2007, at 11:49 AM, Dain Sundstrom wrote:
I'm using 0.9.6
I found the problem. In my entity mappings file, I had a mapping for
a bean that no longer exists. When I comment out that mapping, the
problem goes away. I only fond the problem by turning the debug
level up (the full log is attached). In the log we do warn that the
class was not
Can you tell us your current J2EE vendor, and if possible the
generation strategy selected in the vendor deployment descriptor. If
not,
can you grab the last 20 pks from one of the tables, we may be able
to guess the strategy.
In general, if you vendor is using a UUID, you should able to
On Feb 13, 2007, at 10:06 AM, Hans J. Prueller wrote:
Can you tell us your current J2EE vendor, and if possible the
generation
strategy selected in the vendor deployment descriptor. If not,
can you
grab the last 20 pks from one of the tables, we may be able to
guess the
strategy
One
[
https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472844
]
Dain Sundstrom commented on OPENJPA-142:
I think I found a related bug to this. When you have a mapped
I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity
name when processing queries. In stead it seems to always choose the
class name for the schema name of the bean. For example, I have the
following bean declared in my entity mappings:
entity name=BasicCmp2Bean
I read on the serverside.com that Kodo has passed the JPA tck, and am
curious if there are any uncommitted patches from BEA that are
required to make OpenJPA compliant. Also, has anyone run OpenJPA
through the JPA tck and if so did we pass?
-dain
I have this scenario in my CMP2JPA tool where I have to generate
subclasses of CMP1 beans. When the user has an unknown primary key
or more commonly, when they use the same ejb class for multiple
deployments, I have to generate a sub class to either add an extra
field, or to differentiate
to code it that
way (and yes I am quite lazy).
-dain
On Feb 12, 2007, at 4:00 PM, Dain Sundstrom wrote:
I have this scenario in my CMP2JPA tool where I have to generate
subclasses of CMP1 beans. When the user has an unknown primary
key or more commonly, when they use the same ejb class
When I try to use a simple mapped super class with a trivial sub
class (no fields or methods), I get the following exception:
ERROR - The bean instances business method encountered a system
exception:org.apache.openejb.test.entity.cmp.BasicCmpBean.pcGetManagedFi
eldCount()I
to annotate the mapped superclass?
Craig
On Feb 12, 2007, at 7:01 PM, Dain Sundstrom wrote:
When I try to use a simple mapped super class with a trivial sub
class (no fields or methods), I get the following exception:
ERROR - The bean instances business method encountered a system
+1
The Geronimo API is verified using the official Jee5 signatures file.
-dain
On Feb 8, 2007, at 9:41 PM, Marc Prud'hommeaux wrote:
It turns out that the JPA API we've been building against (the one
from https://maven-repository.dev.java.net/repository/
I like to reserve New Feature to high level new stuff that should be
marketed. Normally, I like to break these down into bite-sized sub
tasks. Most other changes are bug fixes or iterative improvements to
the code base.
-dain
On Feb 5, 2007, at 6:52 PM, Patrick Linskey wrote:
Hi,
+1
-dain
On Feb 3, 2007, at 12:39 AM, Marc Prud'hommeaux wrote:
In the interest of keeping up with the latest-and-greatest, I
propose we upgrade our project dependency on the stand-alone Derby
database JDBC driver for our testing and distribution zip from
Derby 10.2.1.6 to the latest
Due to Apache Incubator policy the archives are only available via
the separate incubator repo at apache.
http://people.apache.org/repo/m2-incubating-repository
For example, the openjpa-all 0.9.6 jar is located here:
http://people.apache.org/repo/m2-incubating-repository/org/apache/
[
https://issues.apache.org/jira/browse/OPENJPA-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469545
]
Dain Sundstrom commented on OPENJPA-123:
You can list excluded tests in the maven pom. If you are using
Does JPA or OpenJPA have support for what is called unknown primary
key in the EJB CMP 2.0 spec. An unknown primary key is the pk of an
entity bean that does not have a field (or abstract getter/setter)
for a primary key. Instead the framework adds a virtual field to the
bean that
My only concern is IDE support and specifically the IDE I use
intellij. Does this work as a test case type in IntelliJ and Eclipse?
If so, I don't really care which framework we use.
-dain
On Feb 1, 2007, at 11:08 AM, Patrick Linskey wrote:
Hi,
According to the discussion at
On Feb 1, 2007, at 11:39 AM, Kevin Sutter wrote:
I see that they have a plugin for Eclipse, but I haven't tried it
yet. It
doesn't look like it supports IntelliJ. On the surface, the
conversion and
usage looks doable and would satisfy the failed testcase problem.
We can exclude tests
it.
-Original Message-
From: Dain Sundstrom [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 01, 2007 10:55 AM
To: open-jpa-dev@incubator.apache.org
Subject: Unknown primary key
Does JPA or OpenJPA have support for what is called unknown primary
key in the EJB CMP 2.0 spec. An unknown
openjpac looks like open j pac to my eyes
-dain
On Feb 1, 2007, at 3:20 PM, Patrick Linskey wrote:
They're only prefixed if you provide a URN for them when you
include the
taskdef. But I'm open to either name.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
On Feb 1, 2007, at 3:27 PM, Patrick Linskey wrote:
3.5.6:
Lifecycle callback methods may throw runtime exceptions. A runtime
exception thrown by a callback method that executes within a
transaction
causes that transaction to be rolled back. No further lifecycle
callback
methods will be
What version of OpenJPA will this be in and did dropTable get
implemented?
-dain
On Jan 2, 2007, at 6:50 PM, Patrick Linskey wrote:
-Original Message-
From: Shay Banon [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 02, 2007 2:33 PM
To: open-jpa-dev@incubator.apache.org
Subject:
I have openjpa setup to auto create my tables, and I see openjpa the
tables using in my log, but I don't see the create table statements.
I have this in my persistenc.xml file
properties
property name=openjpa.Log value=DefaultLevel=TRACE/
property
IIRC this sort of extension would only be allowed if the original
schema http://java.sun.com/xml/ns/persistence/orm; has explicitly
allowed extension. Historically, Sun has made it impossible to
extend their xml documents.
-dain
On Jan 18, 2007, at 6:16 AM, Kevin Sutter wrote:
Do we
On Jan 17, 2007, at 12:07 PM, Patrick Linskey wrote:
The tests can be made to pass by setting the openjpa.DetachState
property to 'fgs',
'loaded' is the proper default. If the CTS is relying on any state
being loaded after a call to getReference(), then those CTS
tests are
wrong and should
I'm getting this exception printed to my log, but my tests work. Is
my test doing something wrong?
2|false|0.9.6-incubating
org.apache.openjpa.util.OptimisticException: Optimistic locking
errors were detected when flushing to the data store. The following
objects may have been
Can you have java field of type byte[] that maps to a NUMERIC (or
heck a varchar) in he db? I'm guessing that Kevin's guid is a fixed
128 bit number. If it is and he can map it to a non-blob type, it
should be possible to join with any database system.
-dain
On Jan 2, 2007, at 3:09 PM,
The BrokerImpl class initializes the _loader to Thread.currentThread
().getContextClassLoader() when constructed (when an EM is
constructed). This cl is used while loading the mappings file. This
causes the entity classes to be loaded from the thread context class
loader instead of the
or entity named in this message. If you are not the intended
recipient,
and have received this message in error, please immediately return
this
by email and then delete it.
-Original Message-
From: Dain Sundstrom [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 31, 2006 9:19 PM
To: open-jpa
On Dec 31, 2006, at 12:04 AM, Marc Prud'hommeaux wrote:
I've never experienced this problem, but as a guess, are you
running with dynamic enhancement (using the -javaagent flag)? If
so, what happens if you enhance manually, and then run without the
agent flag?
Currently, I am, but I can
I working on an implementation of the EJB cmp specification which
uses JPA under the covers to implement the persistence. I have the
basics working with hand written subclasses of the abstract cmp2
beans. I just wrote a code generator to replace my hand coded
subclasses using ASM (which
Actually, never mind. Due to the interconnectedness of persistent
classes (i.e., relationships), I need to generate all the classes at
once and add them all to the class loader at the same time. This
means my elegant solution is just broken :)
-dain
On Dec 31, 2006, at 3:12 PM, Dain
I think is might be intellij because when I use maven to run the
tests and attach remotely it works... kinda sucks :(
-dain
On Dec 30, 2006, at 8:03 PM, Dain Sundstrom wrote:
Anyone having trouble using a debugger with openjpa? When I run
OpenJPA embedded into OpenEJB it seems to corrupt
Also it appears that the Broker be loading classes from the thread
context class loader when persist is called.
-dain
On Dec 27, 2006, at 5:34 PM, Dain Sundstrom wrote:
I've been working on a getting JPA runtime enhancement and have run
into a problem where OpenJPA is loading my classes
Dain,
On Dec 12, 2006, at 7:55 PM, Dain Sundstrom wrote:
If I have a one-to-many set, what is used to determine object
equality in the set: object identity, pk or bean.equals(other)?
You are probably better off using database identity for equality.
If all the elements are of the same
Excellent. That totally worked :)
Thanks,
-dain
On Dec 12, 2006, at 10:05 AM, Abe White wrote:
OneToMany mappings default to using a join table unless you name
the inverse field with mapped-by.
__
_
Notice: This email
On Dec 12, 2006, at 1:45 PM, Craig L Russell wrote:
There's nothing that I can find in the JPA specification about
preserving null vs. empty Collections and Maps. There's no good
(practical) way to implement null values for these types in
relational databases, which is the target of the
On Dec 12, 2006, at 1:51 PM, Craig L Russell wrote:
Hi Dain,
On Dec 11, 2006, at 9:58 AM, Dain Sundstrom wrote:
I'm really working on a replacement for the OpenEJB Castor CMP
container that uses OpenJPA instead. I'm just hacking in the CMRs
right now, hence all the relationship questions
Does JPA guarantee that only one bean will be activated for a
specific pk per transaction? Specifically, will OpenJPA ever create
more that one bean for a specific Class:PK in a single transaction?
The reason I'm asking is I may want to use an identity map and don't
want to end up with
Sorry about he subject free email :)
On Dec 12, 2006, at 6:42 PM, Patrick Linskey wrote:
On Dec 12, 2006, at 6:24 PM, Dain Sundstrom wrote:
Does JPA guarantee that only one bean will be activated for a
specific pk per transaction?
Yes.
Specifically, will OpenJPA ever create more that one
If I have a one-to-many set, what is used to determine object
equality in the set: object identity, pk or bean.equals(other)?
-dain
On Dec 11, 2006, at 2:09 PM, Patrick Linskey wrote:
If you have a null indicator for the collection / map field, then
OpenJPA will preserve the null-ness.
What's that? I see you can specify a column as being not nullable
but I don't see anything in the spec about null and collections.
On Dec 11, 2006, at 6:03 PM, Craig L Russell wrote:
Hi Dain,
I've never seen an @Entity without an @Id annotation. I don't
believe it is a valid JPA mapping without an @Id. That said, it's
not required to be named Id.
I'm not using annotations at all. Everything is done in the mappings
You new it was coming... so do Map based collections work? :)
As many of you know, I'm trying to implement CMP2 on top of OpenJPA.
To implement CMR collection sets, it would be very convenient to have
a MapPK, Bean instead of just a SetBean, so I was very pleased to
see support for this
I am by no means an OpenJPA expert, but I did see something related
to this when reading the docs yesterday. OpenJPA has a
QueryResultsCache where it keeps the results of a query so if you run
the query again you get the same results (I'm not sure if that is
what you want). Here is the
Is there a way to make openjpa create tables automatically for me?
It would make testing much easier.
-dain
I have a very simple one-to-one test that doesn't seem to be
working. The test executes three transactions each with a new entity
manager. In the first tx, I create two bean and persist them. In
the second transaction, I find the two beans again and set the
relationship property. In
On Dec 8, 2006, at 1:34 PM, Pinaki Poddar wrote:
I think it is great for testing, but I am concerned about having to
write code two different ways, one for single node deployment and
another way for a clustered deployment.
is the testing environment a Weblogic cluster? Kodo has a new
88 matches
Mail list logo