Hi,
I am using the following OpenJPA version in an Eclipse RCP app:
OpenJPA 1.2.1
version id: openjpa-1.2.1-r2180:4612
I receive errors when using aliases in a select statement:
Example:
select s.name, count(distinct g) as c from Systems s, IN(s.groups) g group
by s.name order by c
If an exception occurs in remove(), the transaction is still open when the
finally block is performed.
Check whether the trans is active and roll it back if so, as in the
following:
} finally {
if (em != null) {
if (em.getTransaction().isActive()) {
em.getTransaction().rollback();
Hi,
Solved. Problem was that both sides of the bi-directional relationship were
not being assigned before persisting, just one side :
user.getGroups().add(group);
The following fixed the problem:
user.getGroups().add(group);
group.getUsers().add(user);
Interesting that by restarting the
Hi,
I have a bidirectional many-to-many relationship between two entities. Each
entity references a collection of the other entity.
I import data, then retrieve entities with a query. However, when I refer
to an entity's collection, its size is always 0 (eg, group.getUsers().size
() is 0). I
Hi
The OpenJPA describes how to indicate that a field should use OpenJPA's
large result set proxies using the @LRS Java annotation.
Can I specify LRS using orm.xml instead?
Thanks,chris
, not supported in XML
descriptor. Because, JPA spec does not define a XML schema with a simple
name,value mechanism for vendor extensions. OpenJPA can merge source
code
annotations with orm.xml -- so, one has to leave OpenJPA-specific mapping
annotations on source code itself.
Christopher Giblin
Hi,
I have OpenJPA 1.2.1, Derby 10.3 and deal with large result sets. When I
configure openjpa.FetchBatchSize to any number, 0, 1000, whatever, I get
the following exception:
java.util.NoSuchElementException: The result list has been closed.
at
/latest/docs/manual/
manual.html#openjpa.ConnectionRetainMode
[2]
http://openjpa.apache.org/builds/latest/docs/manual/
manual.html#ref_guide_dbsetup_retain
It sounds like you'd benefit from setting it to 'always' or
'transaction'.
Regards
-mike
On Tue, Sep 29, 2009 at 8:08 AM, Christopher
Hi,
I have a class, A, with a one-to-many relationship to another class, B.
Thus A refers to a collection of B.
Normally I want to load the collection lazy and therefore set fetch to
LAZY in my orm.xml. In one case, however, I want to load A eagerly.
I thought the following would do the trick :
Hi,
Does an EntityManager instance correspond one-to-one to a JDBC connection?
When the EM is closed, is the JDBC connection closed? That is, by opening
and closing EMs, is one also opening and closing JDBC connections?
I am using OpenJPA with Derby. There is no connection pooling:
property
... more to the background of my problem :
I create an EM instance and loop, calling persist() on perhaps 2,000
objects in batches of 50.
I run netstat -an | grep 1527 and observe thousands of TCP sessions being
open and closed. Eventually, there are almost 4,000 TCP sockets in
TIME_WAIT state.
= clsMapping.getTable().getPrimaryKey();
hth,
-Jeremy
On Wed, Sep 9, 2009 at 3:31 AM, Christopher Giblin
c...@zurich.ibm.comwrote:
Hi,
I defined object-relational mappings in orm.xml. Works fine.
Is an API available which allows querying of the orm definition for a
given
object? I am
[] fks = clsMapping.getTable().getForeignKeys();
PrimaryKey pk = clsMapping.getTable().getPrimaryKey();
hth,
-Jeremy
On Wed, Sep 9, 2009 at 3:31 AM, Christopher Giblin
c...@zurich.ibm.comwrote:
Hi,
I defined object-relational mappings in orm.xml. Works fine
Hi,
I defined object-relational mappings in orm.xml. Works fine.
Is an API available which allows querying of the orm definition for a given
object? I am programming with reflection and would like to know, given an
object, which of its attributes are primary or foreign keys.
Thanks, chris
Hi,
I have just completed the first steps with OpenJPA running in my Eclipse
RCP app. I use Derby with the EmbeddedDriver. So far so good.
I have another set of plugins, Eclipse Data Tools Project (DTP), which
provide some DB management tools. However, both OpenJPA and DTP want to own
the
Hi,
When I run my test as a standalone Java program, things work.
When I launch the same code from within a plugin in an Eclipse RCP app,
Persistence.createEntityManagerFactory returns null.
I have called Persistence.createEntityManagerFactory both ways, with and
without persistence.xml. Get
On Mon, Jul 20, 2009 at 8:50 AM, Christopher Giblin
c...@zurich.ibm.comwrote:
Hi,
When I run my test as a standalone Java program, things work.
When I launch the same code from within a plugin in an Eclipse RCP app,
Persistence.createEntityManagerFactory returns null.
I have called
17 matches
Mail list logo