(instead of weak) via a new ObjectMapRetainStrategy (available in
3.1M3).
Andrus
On Oct 21, 2011, at 9:22 AM, Marcin Skladaniec wrote:
Hi
There is a discrepancy in behaviour of performQuery between ROP and non-ROP
setup.
lets consider this simple code:
DataContext newContext
Hi
There is a discrepancy in behaviour of performQuery between ROP and
non-ROP setup.
lets consider this simple code:
DataContext newContext = ...
Artist artist = newContext.newObject(Artist.class);
newContext.commitChanges();
Painting painting = newContext.n
Hi
In my application I start embedded derby and jetty http server (as a
servlet container). Then the cayenne runtime is initiated (for both
1tier and ROP).
When the application shuts down I reverse this order, first closing the
cayenne service by runtime.shutdown(), then jetty then db. All s
Hi Bruno
All squares are rectangles, but some rectangles are squares, the query
for rectangles will also give you squares. This is a valid result from
cayenne's perspective.
What you looking for is to query for Rectangle but not Square. I see
three ways of doing that:
- query for Parent, que
This is my thinking as well.
Indeed I have unique indexes defined on the database level. After
reading this thread it seems like I need to remove them until cayenne
adds support for it.
Thanks.
Marcin
On 17/02/11 12:11 AM, Michael Gentry wrote:
I think this discussion kind of ties into Marci
re logging the SQL and can post it?
Also, is "entityIdentifier" being used for inheritance in Cayenne?
(Did you fill something in the "Qualifier" field in the ObjEntity?)
If so, it sounds like you are using it as a singleton?
Thanks,
mrg
On Mon, Feb 14, 2011 at 10:04 PM, Marci
Hello
I have run into a problem which seems to be a bug in cayenne. I have
tried several approaches in order to isolate the direct cause, thinking
it is some kind of misconfiguration in my code, yet no luck.
Using cayenne 3.0, derby (not tested on other db so far).
My cayenne model defines
configure your subclass in web.xml as 'service-class' init parameter of
HessianServlet.
Andrus
On Dec 16, 2010, at 5:17 AM, Marcin Skladaniec wrote:
Hello
I'm struggling with a strange problem. After restructuring our project we have
changed some classpaths.
For a normal, n
Hello
I'm struggling with a strange problem. After restructuring our project
we have changed some classpaths.
For a normal, non-ROP application adding extra classpath to default
configuration have solved the issue.
DefaultConfiguration conf = new DefaultConfiguration();
conf.addClassPath("cay
Hello
I was wondering if someone has tried cayenne with jetty 7 and hessian 4.
After some trial and error I finally got to the stage where servlet is
replying, but cayenne fails to establish ClientChannel. this is the log
org.apache.cayenne.CayenneRuntimeException: [v.3.0.1 Aug 04 2010
18:3
Actually I re-read your question. There is no way of specifying a
default prefetch for a given entity.
Some time ago I lodged a confusing feature request, I think 'default
prefetch' can be solution for it.
(https://issues.apache.org/jira/browse/CAY-1234)
Cheers
Marcin
On 19/05/10 2:11 PM, Gary
Hi Gary
Prefetching a select query which should meet your requirements:
SelectQuery sq = new SelectQuery(Category.class);
sq.addPrefetch(Category.PRODUCTS_PROPERTY);
sq.addPrefetch(Category.PRODUCTS_PROPERTY+"."+Product.ORDERS_PROPERTY);
context.performQuery(sq);
http://cayenne.apache.org/doc30/
Hello
I'm experiencing something which made me wonder how lifecycle callback
work. Let me lay down an example first:
on rop client create two objects and link them together:
artist = context.newObject(Artist.class);
painting = context.newObject(Painting.class);
painting.setArtist(artist);
arti
Hi Andrew
As far as I can tell exposing the PK does not stop cayenne from
allocating them, but the trick might be the PK Generation strategy
(defined in the DbEntity). We are using 'default' strategy, no problems
at all.
Also you can use SQLTemplate query when the PK column was not exposed,
j
Hi
I'm not sure about the environment you are using, but there is an easier way.
Lookup localObject(ObjectId id, Object prototype) in CayenneContext class.
most of the time all you need to do is:
PersistentObject copiedPO = context.localObject(originalPO.getObjectId(), null);
Marcin
On 24/04/
Hi
Just to let everyone know, if you are using prefetches and by mistake
use two routes to the same objects this exception will come up.
Example to illustrate:
SelectQuery on Company
added prefetches
Company.EMPLOYEE+"."+Employee.PERSON
Company.CONTRACTOR+"."+Employee.PERSON
will produce a
I'm using quite recent build, svn 762177
Marcin
On 11/05/2009, at 4:41 PM, Andrey Razumovsky wrote:
I think I've seen something similiar. Is this the latest Cayenne
build?
Could you open a JIRA bug (and possibly provide a JUnit test)?
2009/5/11 Marcin Skladaniec
Hello
I have
Hello
I have noticed a problem in ROP cayenne. It seems like the reverse
relationship is not set until the actual relation is faulted.
Simple example:
this works correctly:
logger.warn(artist.getPaintings().size()); -> prints 0
painting.setArtist(artist);
logger.warn(artist.getPaintings().siz
Hi
I have tried to use the nested contexts today. I tried a
very simple thing, creating two objects one in the parent
one in the child context, then linking them together:
ObjectContext aContext = ContextManager.getNewContext();
ObjectContext childContext =
aContext.createChildContext();
S
Hi
I have created a schema with single table inheritance.
It looks something like this: 'Product' is the table,
database entity, and abstract object entity. There are few
subclasses of the Product, each has its own unique
attributes and relationships.
Product:
id
name
description
type (Articl
On 05/07/2008, at 8:51 PM, Andrus Adamchik wrote:
On Jul 5, 2008, at 8:20 AM, Marcin Skladaniec wrote:
During my tests I was fetching 1k, 10k or 100k records using ROP.
Select queries with no paging, no query caching. It was always that
the first query took a while longer (about 20
Hi
I spent some time today trying to find correlation between the object
cache size and application performance to establish what setting would
be the best.
Initially the object cache was set to 5000, which I thought is too
low, since in our app we often fetch tens of thousands of records.
Hi
This was something I reported before , but I cannot find
the message anymore.
Are you using caching ? what type ? are you using cache
keys ?
Try:
a) new RefreshQuery(artist)
b) do a query in new context
c) do a query in new context with no caching.
In our setup we have overriden the Cayen
On 20/06/2008, at 7:07 PM, Øyvind Harboe wrote:
A query returns a List. This always seemed too broad an
interface for that return value to me.
There are two things that I dare do with the list that is returned:
- iterate over it
- ask for it's size()
A List promises so many things:
- can I
Sorry everyone, I sent my last message to the list by mistake...
Marcin
On 11/06/2008, at 7:58 AM, Marcin Skladaniec wrote:
there is no simple way, see what I did in allRecordsCount in
ListController. Yo wont translate IN statement and other easily though
Marcin
On 10/06/2008, at 4:26 PM
there is no simple way, see what I did in allRecordsCount in
ListController. Yo wont translate IN statement and other easily though
Marcin
On 10/06/2008, at 4:26 PM, Lachlan Deck wrote:
Hi there,
(question related to ROP)
say I've got an Expression (whether complex or otherwise) and I want
Verified
Thank you
Marcin
On 14/05/2008, at 10:54 PM, Andrus Adamchik wrote:
Fixed.
On May 13, 2008, at 2:16 PM, Andrus Adamchik wrote:
Doh! I'll investigate tonight.
Andrus
On May 13, 2008, at 1:31 PM, Marcin Skladaniec wrote:
Hi
We have updated to M4 and since then this exce
or events). This would allow to reuse the main ROP connection,
but this needs to be developed yet.
Andrus
On May 7, 2008, at 7:25 PM, Marcin Skladaniec wrote:
Hi
In our application we are using LOCAL_CACHE and cache keys to
refresh it, but only for a special context called 'shared
Hi
We have updated to M4 and since then this exception started to show up
(for some entities only) :
[java] org.apache.cayenne.CayenneRuntimeException: [v.3.0-SNAPSHOT
May 13 2008 16:16:55] Remote error. URL - http://localhost:8181/angel-server-cayenne
; CAUSE - java.lang.NullPointerExcep
Hi
In our application we are using LOCAL_CACHE and cache keys to refresh
it, but only for a special context called 'shared' . We have
overridden the CayenneContext commitChanges with following to ensure
cache invalidation on every commit :
if (!isSharedContext()) {
I'm not sure, but try this:
query.setCachePolicy(QueryMetadata.LOCAL_CACHE_REFRESH); // or
SHARED_CACHE_REFRESH
or
query.setRefreshingObjects(true)
this will force the refresh of the results of the query you execute,
regardless of what they are
Cheers
Marcin
On 01/04/2008, at 11:13 AM,
Hi Andreas
I might be wrong, but why you just create the Basket and the
relationship to Book and don't commit the context until the user logs
in ? :
on adding item:
Basket row = _context.newObject(Basket.class);
row.addToBooks(someBook);
on successful login:
row.setUser(someUser);
_context
Hi
Lifecycle listeners do work on ROP, just are invoked in a little
different fashion than in 'normal' cayenne. For example during
prePersist you cannot follow any relationships.
Regarding the notifications, I believe some time ago Andrus started
adding a mechanism to propagate the changes
Thank you very much for the reply, I need to read through one more
time and I'll try to make use of it as well as write some
documentation down for the website.
Marcin
On 05/03/2008, at 9:20 PM, Andrus Adamchik wrote:
On Mar 4, 2008, at 1:26 AM, Marcin Skladaniec wrote:
Hi
Hi
The documentation on caching (http://cayenne.apache.org/doc/caching-and-fresh-data.html
and http://cayenne.apache.org/doc/object-caching.html) isn't very
comprehensive, it does not answer questions like:
- what is actually stored in cache pks? datarows ? objectIds ?
- does caching change
Hi
Using ROP, paging and LOCAL_CACHE in cayenne built from trunk about
month ago I'm trying to force cache refresh using
performGenericQuery(new RefreshQuery(object)); but it does not seem to
work.
Is it a right way to refresh the cache ? Could someone advice on what
to debug to figure ou
Hi
Short comment on the cayenne sorted queries, they work great but be
aware of a limitation:
(the query examples assume one to many relation Artist-Painting)
SelectQuery query = new SelectQuery(Painting.class);
query.addOrdering(Painting.ARTIST_PROPERTY+"."+Artist.LAST_NAME,true);
will not r
icate key is created?
Andrus
On Jan 17, 2008, at 8:28 AM, Marcin Skladaniec wrote:
Hello
I have encountered an exception when trying to merge relationships
using this code :
Artist source;
Artist destination;
while (source.getPaintings().size() > 0) {
Object val
Hello
I have encountered an exception when trying to merge relationships
using this code :
Artist source;
Artist destination;
while (source.getPaintings().size() > 0) {
Object value = source. getPaintings().get(0);
source.removeFromPaintings(value);
destination.addToP
an extra
condition check for super-lazy faulting of to-ones.
Andrus
On Nov 26, 2007, at 2:45 AM, Marcin Skladaniec wrote:
Hi
I have problems with entity qualifier and relationships. I defined
"isDeleted" column in few tables, and when the record is deleted is
not really remo
Hi
I have problems with entity qualifier and relationships. I defined
"isDeleted" column in few tables, and when the record is deleted is
not really removed from the database. In cayenne modeller I specified
a entity qualifier to not include those deleted objects in any query,
but I found
Hello
We are using the lifecycle callbacks for quite a while, and after
initial troubles all was good. Recently we have discovered that
whenever we call any getter in the prePersist it does return null. It
does apply to relationships and to fields, and it does not matter if
the object was
Hi
I have a problem which is bothering me for quite a long time. It is
about the exception messages being munched on the server, an example :
Simple one to many relationship : Student -< Enrolments, there is a
deny rule on the student side.
Because of some bug the fact that the student ha
y guess is that localObject is ALWAYS orders of magnitude faster.
I suspect it'd be extremely difficult to define a situation where this
was not the case.
On 11/1/07, Marcin Skladaniec <[EMAIL PROTECTED]> wrote:
Hi
We are improving the performance of our client application (ROP). Not
surpr
Hi
We are improving the performance of our client application (ROP). Not
surprisingly we have found that adding prefetches did improve the
speed significantly.
I have a question though about which is about efficiency of
localObject. We are fetching a list of objects (query with prefetches
Hello
I think recently the requirement every relationship to be defined
both ways was revoked.
I found few problems with it:
we have defined (to many, read only):
deleteRule="Nullify" db-relationship-path="CourseClasses.sessions"/>
it looks like cayenne creates fake relationship called
run
structor taking 3% of the 'fillIn' method time).
Andrus
On Jun 26, 2007, at 10:55 AM, Marcin Skladaniec wrote:
Hi Andrus !
Many thanks for that !
Marcin
On 26/06/2007, at 5:39 PM, Andrus Adamchik wrote:
Hi Marcin,
1) SelectQuery(Student.class) with page size 10 takes 30-50
se
inute later tonight and implement id-
only fetch. I have some large tables in a MySQL5 so I can test the
performance in a slightly different environment.
Andrus
On Jun 26, 2007, at 9:26 AM, Marcin Skladaniec wrote:
Hi
I have done some more profiling and testing.
executing queries on table
- dealing with adding and concatenating Expressions to the
SQLTemplate (is there an easy way ?)
- dealing with declared qualifier (the one set in modeller)
- possibly more...
i would really like to avoid all of that, so if you have any ideas on
how to improve the performance without too much ha
Hi Andrus
I had not much time to check, but with the fix the 100k records load
in 30 instead of 50 seconds. It is some improvement, but not enough.
I'll do some more profiling tomorrow and let you know.
By the way, we are using netbeans for profiling, the benefit : it is
free. I will eval
Hi
Recently we have found that fetching a list of 100,000 records using
ROP with paging and no cache takes a long time, about 50 seconds in
our case. We have profiled the cpu usage and the result shows that
99% of time is spent in IncrementalFaultList, within the fillIn()
method.
The fil
only one of them is fired when using
anObject.getObjectContext().newObject().
Marcin
On 02/06/2007, at 11:43 AM, Marcin Skladaniec wrote:
Hi
I'm having a strange problem. When executing this bit of code:
List categories = aContext.performQuery(new SelectQuery
(Category.class));
i
Hi everyone
I'm having some troubles with SQLTemplate. The one I use is fairly
simple:
SQLTemplate query = new SQLTemplate(Student.class, "select * from
Student WHERE isDeleted = 1");
the student entity is defined by :
... some other fields here ...
isMandator
Hi
I'm having a strange problem. When executing this bit of code:
List categories = aContext.performQuery(new SelectQuery
(Category.class));
if (categories.size() != 0) {
for (int categoriesCount = 0; categoriesCount < categories.size();
categoriesCount++) {
Category cat = (
does not show up in the output... So
there's something else. Could you post the code you are using to
build and call the query on the client?
Andrus
On May 14, 2007, at 3:39 AM, Marcin Skladaniec wrote:
Hi
I did some more debugging and I found that SQLTemplate on client :
re something I'm doing wrong ?
Marcin
On 13/05/2007, at 8:29 PM, Marcin Skladaniec wrote:
Hi
In our project we needed a generic way to relate many different
entities. Cayenne does not allow vertical inheritance, therefore I
had to make my way around, and create a fake relationshi
Hi
In our project we needed a generic way to relate many different
entities. Cayenne does not allow vertical inheritance, therefore I
had to make my way around, and create a fake relationship. I'm using
custom superclass for entities, in which accessing methods, like the
one in cayenne ar
Hello
In our application we utilise prePersist on server to update some
information about the committed object (ie. createdOn), but there is
a problem, the values set in the prePersist are not returned with the
object to the client. Re-fetching the object gives all the correct
values. Exa
Hi
In our project we have tried using inheritance, this is the
simplification of the map we are using:
isMandatory="true"/>
className="ish.oncourse.server.cayenne.AbstractNode"
clientClassName="ish.oncourse.cayenne.Abs
Hi
I use remote persistence, and I have a dozen objects in the context,
and I would like to try to check if one of them can be deleted.
Can I just call recordToBeDeleted.validateForDelete() before I call
context.deleteRecord( recordToBeDeleted ) ?
From my understanding context.deleteRecord wi
We are upgrading the data, and we are just touching objects (setting
new modifiedOn value) to make them run the postUpdate().
All happens on server. All objects are committed together. New
modifiedOn value is saved to db, but postUpdate never runs.
Regards
Marcin
On 14/03/2007, at 8:59 PM, An
Hello
I cant find a link to cayenne javadocs. I have them built from
source, but it would be good to be able to email a link to someone.
Marcin
ly works for
> to-one relations. For to-many relations, I can't remember how I
> handled this.
>
>
> On 2/28/07, Marcin Skladaniec <[EMAIL PROTECTED]> wrote:
>> Hi
>> Mike, the ExpressionFactory.noMatchExp(AppleTree.APPLE_PROPERTY,
>> null) does not
o-many relations, I can't remember how I
handled this.
On 2/28/07, Marcin Skladaniec <[EMAIL PROTECTED]> wrote:
Hi
Mike, the ExpressionFactory.noMatchExp(AppleTree.APPLE_PROPERTY,
null) does not work. I tried. I recollect I used Expression which
aimed other way around (from many to one, ex
patch.
On 2/27/07, Marcin Skladaniec <[EMAIL PROTECTED]> wrote:
Hi
I have a simple one-to-many relationship : AppleTree - Apple. I'm
doing a query :
new SelectQuery(AppleTree.class, expression)
how should the expression look like to return the trees with app
Hi
I have a simple one-to-many relationship : AppleTree - Apple. I'm
doing a query :
new SelectQuery(AppleTree.class, expression)
how should the expression look like to return the trees with apples ?
expression = ExpressionFactory.noMatchExp(AppleTree.APPLES, null)
does not seem to work, nei
Hi
schedule_date = CURDATE():
what is the schedule_date data type ? Check if you are not comparing
TIMESTAMP with DATE.
I would use the functionality of NamedQuery. All you do you define a
Query in Modeller, example :
SELECT #result('count(*)' 'int' 'C') FROM $entityName $whereClause
and
CAY-742
Andrus
On Jan 25, 2007, at 6:37 AM, Marcin Skladaniec wrote:
Hello.
I just wanted to share my recent findings about deleteObject() and
localObject() in remote cayenne
(assuming that there is only one apple in the db)
Apple apple1 = (Apple)context1.performQuery(Apple.class).get(0
Hello.
I just wanted to share my recent findings about deleteObject() and
localObject() in remote cayenne
(assuming that there is only one apple in the db)
Apple apple1 = (Apple)context1.performQuery(Apple.class).get(0);
Apple apple2 = (Apple)context2.performQuery(Apple.class).get(0);
contex
69 matches
Mail list logo