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
Error
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 a
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 l
nately, not supported in XML
> descriptor. Because, JPA spec does not define a XML schema with a simple
> 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.
>
&
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
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 org.apache.openjpa.lib.rop.AbstractResultList
x27;.
>
> Regards
> -mike
>
> On Tue, Sep 29, 2009 at 8:08 AM, Christopher Giblin
wrote:
>
> >
> > Hi,
> > Is there any way to influence OpenJPA's connection usage when not using
> > connection pooling?
> >
> > I plan to move to connection p
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 tri
Hi,
Is there any way to influence OpenJPA's connection usage when not using
connection pooling?
I plan to move to connection pooling in the future but cannot quite at the
moment. My OpenJPA is configured to use Derby ClientDataSource. When
iterating over objects with lazy-loaded attributes, the q
... 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.
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:
Sorry if
> ClassMapping clsMapping =
> > (ClassMapping)JPAFacadeHelper.getMetaData(em, SomeEntity.class);
> >
> > ForeignKey[] fks = clsMapping.getTable().getForeignKeys();
> > PrimaryKey pk = clsMapping.getTable().getPrimaryKey();
> >
> > hth,
ForeignKey[] fks = clsMapping.getTable().getForeignKeys();
> PrimaryKey pk = clsMapping.getTable().getPrimaryKey();
>
> hth,
> -Jeremy
>
> On Wed, Sep 9, 2009 at 3:31 AM, Christopher Giblin
wrote:
>
> >
> > Hi,
> > I defined object-relational mappings in orm.
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 am developing an Eclipse RCP app with OpenJPA. That is, Java SE, not Java
EE.
I would like to enable connection pooling and have questions regarding
Derby and DB2:
1) Has anyone a OpenJPA config example for DB2 and connection pooling?
2) Is the only way to enable JDBC connection pooling fo
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 Derby
classpath for your RCP
application.
> Hopefully this helps!
>
> -Rick
>
> On Mon, Jul 20, 2009 at 8:50 AM, Christopher Giblin
wrote:
>
> >
> > Hi,
> > When I run my test as a standalone Java program, things work.
> > When I launch the same code from within a p
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 null
19 matches
Mail list logo