Re: Mysql Connector/J ReplicantConnection

2009-03-08 Thread Fernando Padilla
Thank you. I have no idea if anyone else uses this field for any other optimizations, or what not.. but it most like can't hurt. :) :) Pinaki Poddar wrote: Hi, JIRA [1] created. [1] https://issues.apache.org/jira/browse/OPENJPA-966

Mysql Connector/J ReplicantConnection

2009-03-05 Thread Fernando Padilla
Have you heard of this? http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-replication-connection.html I was wondering if OpenJPA was good at calling the Connection.setReadOnly() method as appropriate ( true when new connection, false once transaction is started )?? If OpenJPA did

default @Enumerated and @Temporal

2009-01-02 Thread Fernando Padilla
So I am using JPA, and I was wondering if I could set the defaults for @Enumerated(EnumType.STRING) and @Temporal(TemporalType.Timestamp). Currently I am overriding the Mapping defaults (to have defaults be closer to kodo defaults), but I don't know where I can tell OpenJPA the default values

[ot] mysql connections, always making lots of calls

2008-12-17 Thread Fernando Padilla
So I turned on logging of mysql queries (mysql connector/j), and it looks like everytime a connection is gotten from the connection pool, it executes a handful of queries against mysql. I was wondering if anyone has run into this, and if there is a way to avoid all of the extra calls..

Re: Does DataCache support RW (Infrequently)

2008-12-12 Thread Fernando Padilla
So there are various levels of cache. L1 = Within one EntityManager L2 = Within one EntityManagerFactory ( openjpa.DataCache=true) The default DataCache implementation used by an EntityManagerFactory is essentially backed by a simple Map. So if you have more than one EntityManagerFacotry ( wi

Re: Targeted Query in Slices

2008-12-03 Thread Fernando Padilla
Any progress on this?? ps - Since I'm committing myself to moving our company to openjpa-slices I am very interested in any and all bugs with slices :) :) (though i'm not a developer in openjpa) thiago ananias wrote: Hello again Pinaki! I'm running this simple test: import java.util.*;

Re: dual node URLs (of SolidDB)

2008-12-03 Thread Fernando Padilla
I think supporting commas in the url should be supported for any database server (mysql also has support for loadbalanced replicants, etc etc). Have you filed a bug for this yet? Jaeger, Michael wrote: Hi all, we know that soliddb is not among the supported databases of OpenJPA. Thus we wou

issues with closing/opening entity manager (slices)

2008-11-26 Thread Fernando Padilla
So i got unique queries working with slices (hoorah), look at the appropriate bug (maybe OPENJPA-793) for the patch. But now I hit this really nasty bug, that I can't create new entity managers after I close an old one.. even though the same code works with normal openjpa (non-slice). So the

Re: issues with unique query, using slices

2008-11-26 Thread Fernando Padilla
The simple version of the patch is here in the bug.. two line change. https://issues.apache.org/jira/browse/OPENJPA-787 I'll leave the renaming and cleaning of "UniqueResponseObjectProvider" to a later time; janitorial work.. Pinaki Poddar wrote: Good. we will wait for your patch.

Re: issues with unique query, using slices

2008-11-26 Thread Fernando Padilla
cool. I'm reviewing the code, and it looks simple to fix. The bug is that in DistributedStoreQuery.executeQuery, it is getting confused between isUnique and isAggregate. It needs to do some fancy aggregation work for aggregated queries ( avg, sum, count, etc ), but it doesn't need to do anyth

Re: issues with unique query, using slices

2008-11-26 Thread Fernando Padilla
RA issues, but this looks look a good candidate. We'll certainly consider any patches you come up with. -mike On Tue, Nov 25, 2008 at 9:15 PM, Fernando Padilla <[EMAIL PROTECTED]> wrote: 1) wha? So.. wow. wow. 2) ok, but next issue, is that it looks like it was returning an empty

Re: issues with unique query, using slices

2008-11-25 Thread Fernando Padilla
1) wha? So.. wow. wow. 2) ok, but next issue, is that it looks like it was returning an empty array, not an array with the single element.. Unless maybe the debug printing method was mis-bahaving.. 3) So.. any ideas on what code needs to be fixed?? This is very sad. Do you think I could re

Re: having issues with slices :(

2008-11-25 Thread Fernando Padilla
sword. Fernando Padilla wrote: So starting to walk through all the logs, it looks like username and password are null?? The log is below, saying mysql is not getting a username/password. But I am properly setting the configuration for each slice: openjpa.slice.Slice1.ConnectionPas

Re: having issues with slices :(

2008-11-25 Thread Fernando Padilla
Source.getConnection(DelegatingDataSource.java:112) at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:93) at org.apache.openjpa.slice.jdbc.DistributedDataSource.getConnection(DistributedDataSource.java:81) at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:23

having issues with slices :(

2008-11-25 Thread Fernando Padilla
So, I am now trying to use slices, but it's not working. :( attached is a log file of my run (it has openjpa at TRACE). I am experimenting with a very simple configuration (a single slice and 2.0.0-SNAPSHOT), but it ultimately throws an exception: "A connection could not be obtained for drive

Re: JPQL Query with embedded object

2008-11-10 Thread Fernando Padilla
So you're saying is that OpenJPA does not support querying of Embedded objects, but it does support querying fields of embedded objects? So, do you think this could be corrected in openjpa code? I would suggest that we might want to wade through code and maybe submit a patch.. could you point

Re: snapshot build repository?

2008-10-27 Thread Fernando Padilla
, Oct 26, 2008 at 1:46 PM, Fernando Padilla <[EMAIL PROTECTED]> wrote: So I was reading the docs, and I checked out the two repositories mentioned (urls below), but I can't find a snapshots of the 1.3 series. Are those being maintained anywhere? http://openjpa.apache.org/obtaining.h

snapshot build repository?

2008-10-26 Thread Fernando Padilla
So I was reading the docs, and I checked out the two repositories mentioned (urls below), but I can't find a snapshots of the 1.3 series. Are those being maintained anywhere? http://openjpa.apache.org/obtaining.html http://people.apache.org/repo/m2-snapshot-repository http://people.apache.org/

Slices, Collocation Constraint

2008-10-25 Thread Fernando Padilla
So according to the documentation, Slices has a "Collocation Constraint" (copied below). Can the experts comment on this requirement? Is there any way to remove or ignore that requirement? With extra code, or enhancements to openjpa? Or with accepting extra caveats? I would like to have an

Re: ordered Lists, with list position in join table

2008-10-24 Thread Fernando Padilla
HBaseIdCreateTime { @ManyToMany @OrderColumn(name="DRAFTORDER_ORDER") private List draftOrder; } hth -mike On Fri, Oct 24, 2008 at 2:11 PM, Fernando Padilla <[EMAIL PROTECTED]> wrote: :( it's not. the sort column lives purely in the relation

Re: ordered Lists, with list position in join table

2008-10-24 Thread Fernando Padilla
cify a fieldname we'll sort by primary key. Regards, -mike On Fri, Oct 24, 2008 at 12:26 PM, Fernando Padilla <[EMAIL PROTECTED]>wrote: So, again, I'm trying to port from old JDO to new JPA :) And I'm trying to map a List object, where the relational table is storing the po

mapping Set

2008-10-24 Thread Fernando Padilla
So.. I have a field that I don't konw how to map: private Set relatedAthletes; I think I understand how to relate two entities together, but not sure how to relate an Entity to a Set of "primitive" or Basic data types.

ordered Lists, with list position in join table

2008-10-24 Thread Fernando Padilla
So, again, I'm trying to port from old JDO to new JPA :) And I'm trying to map a List object, where the relational table is storing the position of each element. It looks like standard JPA doesn't want to support this, but I was wondering if OpenJPA had this as an option in some way...: A

Re: should EntityManager.refresh require active transaction? or not?

2008-10-23 Thread Fernando Padilla
ounds like a bug. Unless I am not understanding your scenario... Kevin On Thu, Oct 23, 2008 at 12:17 PM, Fernando Padilla <[EMAIL PROTECTED]>wrote: oh. that's interesting. A slight difference in point of view. I don't see those "changes" as changes that are to be t

Re: custom data fields

2008-10-23 Thread Fernando Padilla
I read that, and got a ValueHandler going and all, but I was still having some issues. And I didn't know how to annotate the fields that have ValueHandlers you know.. like is that @Embedded, or @OneToOne or @Persistent, or @Basic, etc etc.. Pinaki Poddar wrote: So. any examples on how to us

Re: should EntityManager.refresh require active transaction? or not?

2008-10-23 Thread Fernando Padilla
oh. that's interesting. A slight difference in point of view. I don't see those "changes" as changes that are to be tracked within a transaction, since those changes are not to be applied to the database ever.. they are just refreshing your view of the authoritative version in the db.. do

should EntityManager.refresh require active transaction? or not?

2008-10-22 Thread Fernando Padilla
I am trying to use EM.refresh outside of a transaction. But OpenJPA throws an exception, saying that it wants it to be within a transaction. Any reason for this?? org.apache.openjpa.persistence.TransactionRequiredException: To perform this operation, it must be written within a transactio

custom data fields

2008-10-22 Thread Fernando Padilla
So. any examples on how to use the custon data fields properly? Do I need any extra annotations? @Basic @Column(name="DATA0") private CustomData data; and I have registered a ValueHandler that deals with CustomData type..

null values for @Embbeded fields

2008-10-22 Thread Fernando Padilla
So.. does OpenJPA support null values for @Embbeded fields? I want a class to have an @Embbeded field, but I want that field to be possibly null..

Re: Default Table/Column Naming conventions; are they configurable?

2008-10-22 Thread Fernando Padilla
Just found this really nice tutorial.. I'm trying it now, hopefully it'll work. :) Thank you all! http://www.oracle.com/technology/products/ias/toplink/jpa/howto/id-generation.html Fernando Padilla wrote: Sorry. :) I am new to JPA and mostly trying to 'port' our code fro

can I use Embedded objects in a query?

2008-10-21 Thread Fernando Padilla
I have an object with an @Embedded sub object (which only contains a long as a sub field). It looks to work just fine, except when I try to query the using that field. You can see from the logs, that the JPQL query is OK (with correct parameter), yet the SQL it generates replaces the "this.pt

Re: Default Table/Column Naming conventions; are they configurable?

2008-10-21 Thread Fernando Padilla
Sorry. :) I am new to JPA and mostly trying to 'port' our code from using Kodo, while still using the old kodo schema, etc.. So I've got most of my mappings setup and working, but for reading only, since writing requires a properly setup sequence generator. My next step is to setup the JPA

Re: Default Table/Column Naming conventions; are they configurable?

2008-10-20 Thread Fernando Padilla
OpenJPA? Fernando Padilla wrote: um. So i just tried to do that. My first attempt, I was just trying to do logging while delegate to MappingDefaultsImpl, by both wrapping and/or extending. But I keep getting null pointer exceptions. What do you suggest? How would I get started in creating

Re: Default Table/Column Naming conventions; are they configurable?

2008-10-20 Thread Fernando Padilla
? Pinaki Poddar wrote: Hi, Fernando Padilla wrote: So, is there any way that I can plugin a class to determine the default TABLE/COLUMN names? Start looking from interface org.apache.openjpa.jdbc.meta.MappingDefaults and its 'JPA'-specifc impl

Re: collection.contains, member of?

2008-10-20 Thread Fernando Padilla
thank you! much relieved that I didn't have to do anything drastic! this is much better :) Pinaki Poddar wrote: Hi, This use case is better served by IN expression. There is no need to expand the elements of parameter collection and append them dynamically. The MEMBER OF expression accepts a

Re: collection.contains, member of?

2008-10-17 Thread Fernando Padilla
the parameter p0 is just a collection of objects of the same type as the field we're testing against.. here is what I'm currently thinking. 'field' could be string, or int, or another entity. the ':col' is a collection of the same type as 'field'. this is what we do with jdo: :col.contains

collection.contains, member of?

2008-10-16 Thread Fernando Padilla
So in jdo I could do: ?.contains( fbId ) how would I do that in JPA? I'm trying this out, but it's complaining: select this from com.protrade.fandom.data.entities.Fan this where this.fbId MEMBER OF :p0; org.apache.openjpa.persistence.ArgumentException: Encountered "this . fbId MEMBER OF

Re: Default Table/Column Naming conventions; are they configurable?

2008-10-16 Thread Fernando Padilla
So, is there any way that I can plugin a class to determine the default TABLE/COLUMN names? Fernando Padilla wrote: I am trying to figure out how to override the default naming conventions used by OpenJPA, to be more consistent with the schema we currently have (generated by old kodo

Re: custom types

2008-10-16 Thread Fernando Padilla
An aside, is there a standard JPA way to encode 'custom' types, or externalizer/factory type setups? Fernando Padilla wrote: Though I do like the ease of use of Externalizer/Factory, I was just wondering if I could register my custom datatypes, so that they will be treated almost l

custom types

2008-10-16 Thread Fernando Padilla
Though I do like the ease of use of Externalizer/Factory, I was just wondering if I could register my custom datatypes, so that they will be treated almost like native types, so I have less meta-data to maintain.. 1) @Persistent @Externalizer("getIdLong") private TeamId

Default Table/Column Naming conventions

2008-10-16 Thread Fernando Padilla
I am trying to figure out how to override the default naming conventions used by OpenJPA, to be more consistent with the schema we currently have (generated by old kodo): - all caps - append a 0 if it's a reserved word - append a counter if multiple columns of same name ( embedded ) I bet the

Re: having issues with first query.

2008-10-16 Thread Fernando Padilla
having to go through my whole data model and fill those in, but at least better than the alternative of it not working at all! :) So anyone have any shortcuts, so that OpenJPA would just make a ManyToOne assumption? possibly? Fernando Padilla wrote: thank you for replying! Fan and T

Re: having issues with first query.

2008-10-16 Thread Fernando Padilla
quot;. 2008-10-16 10:56:08,472 [btpool0-1] DEBUG openjpa.MetaData - "fan" has mapping strategy "org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy". Fernando Padilla wrote: thank you for replying! Fan and TeamFan are entities of course. They extend a MappedSuperc

Re: having issues with first query.

2008-10-16 Thread Fernando Padilla
thank you for replying! Fan and TeamFan are entities of course. They extend a MappedSuperclass. Here are the four classes involved in this query. Fan and TeamFan extend HBaseIdCreateTime, which extends HBaseId. And just to recap from last email: I load a "Fan" object via the "fbId" field,

having issues with first query.

2008-10-15 Thread Fernando Padilla
Hello. I'm in the process of converting a project from JDO (kodo 3.3.4), into OpenJPA. And now I need some help, because it's failing on the second query that it runs. :) Below you'll see the first query, loading up a "Fan" object via a field "fbId". The second query tries to load a "TeamFa