Re: problem with ROP query performance

2011-10-26 Thread Marcin Skladaniec
(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

problem with ROP query performance

2011-10-20 Thread Marcin Skladaniec
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

runtime shutdown

2011-05-26 Thread Marcin Skladaniec
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

Re: Querying on Inherited Objects

2011-03-07 Thread Marcin Skladaniec
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

Re: Unique Indexes with the modeller

2011-02-16 Thread Marcin Skladaniec
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: possible bug with inherited cayenne objects and mandatory fields

2011-02-15 Thread Marcin Skladaniec
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

possible bug with inherited cayenne objects and mandatory fields

2011-02-14 Thread Marcin Skladaniec
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

Re: problem with DefaultConfiguration in ROP

2010-12-16 Thread Marcin Skladaniec
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

problem with DefaultConfiguration in ROP

2010-12-15 Thread Marcin Skladaniec
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

problems after upgrading jetty and hessian to the latest version

2010-11-16 Thread Marcin Skladaniec
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

Re: Default Prefetching

2010-05-18 Thread Marcin Skladaniec
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

Re: Default Prefetching

2010-05-18 Thread Marcin Skladaniec
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/

lifecycle callbacks, order of execution

2010-05-18 Thread Marcin Skladaniec
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

Re: Primary Key Access and Exposed Primary Keys

2010-05-03 Thread Marcin Skladaniec
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

Re: different ObjectContext...

2010-04-26 Thread Marcin Skladaniec
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/

No inheritance - there must be only one override set when mis-configured prefetches.

2009-07-01 Thread Marcin Skladaniec
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

Re: problems in setting reverse relationship

2009-05-11 Thread Marcin Skladaniec
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

problems in setting reverse relationship

2009-05-10 Thread Marcin Skladaniec
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

nested contexts

2009-01-12 Thread Marcin Skladaniec
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

Single table inheritance and field hiding

2009-01-07 Thread Marcin Skladaniec
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

Re: estimating proper object cache size

2008-07-05 Thread Marcin Skladaniec
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

estimating proper object cache size

2008-07-04 Thread Marcin Skladaniec
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.

Re: RefreshQuery not supports insert/delete?

2008-06-24 Thread Marcin Skladaniec
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

Re: List methods returned from a paged query

2008-06-20 Thread Marcin Skladaniec
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

Re: NamedQuery / SQLTemplate keyPath validation

2008-06-10 Thread Marcin Skladaniec
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

Re: NamedQuery / SQLTemplate keyPath validation

2008-06-10 Thread Marcin Skladaniec
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

Re: bug in M4

2008-05-14 Thread Marcin Skladaniec
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

Re: relationship query and cache refreshing in 3tier cayenne

2008-05-14 Thread Marcin Skladaniec
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

bug in M4

2008-05-13 Thread Marcin Skladaniec
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

relationship query and cache refreshing in 3tier cayenne

2008-05-07 Thread Marcin Skladaniec
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()) {

Re: How to propoerly close context db connection

2008-03-31 Thread Marcin Skladaniec
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,

Re: Handling uncommitted objects with relations? (3.0M3)

2008-03-20 Thread Marcin Skladaniec
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

Re: ROP & lifecycle

2008-03-18 Thread Marcin Skladaniec
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

Re: caching documentation

2008-03-05 Thread Marcin Skladaniec
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

caching documentation

2008-03-03 Thread Marcin Skladaniec
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

cache and RefreshQuery

2008-03-03 Thread Marcin Skladaniec
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

Re: Cayenne and Spring (a Hibernate inspired question)

2008-02-28 Thread Marcin Skladaniec
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

Re: merging relationships

2008-01-18 Thread Marcin Skladaniec
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

merging relationships

2008-01-16 Thread Marcin Skladaniec
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

Re: relationship query and entity qualifier

2007-11-26 Thread Marcin Skladaniec
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

relationship query and entity qualifier

2007-11-25 Thread Marcin Skladaniec
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

prePersist problem

2007-11-17 Thread Marcin Skladaniec
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

ROP and exceptions

2007-11-03 Thread Marcin Skladaniec
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

Re: localObject vs prefetches: would there be a benefit ?

2007-11-02 Thread Marcin Skladaniec
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

localObject vs prefetches: would there be a benefit ?

2007-11-01 Thread Marcin Skladaniec
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

ROP, flattened relationships and no-reverse relationship and/or dotemplates

2007-08-14 Thread Marcin Skladaniec
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

Re: paged query slow when fetching big lists

2007-06-26 Thread Marcin Skladaniec
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

Re: paged query slow when fetching big lists

2007-06-26 Thread Marcin Skladaniec
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

Re: paged query slow when fetching big lists

2007-06-25 Thread Marcin Skladaniec
- 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

Re: paged query slow when fetching big lists

2007-06-25 Thread Marcin Skladaniec
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

paged query slow when fetching big lists

2007-06-21 Thread Marcin Skladaniec
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

Re: weird problems with context

2007-06-04 Thread Marcin Skladaniec
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

SQLTemplate not faulting an object

2007-06-04 Thread Marcin Skladaniec
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

weird problems with context

2007-06-01 Thread Marcin Skladaniec
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 = (

Re: complex query and SQLtemplate

2007-05-14 Thread Marcin Skladaniec
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: complex query and SQLtemplate

2007-05-13 Thread Marcin Skladaniec
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

complex query and SQLtemplate

2007-05-13 Thread Marcin Skladaniec
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

ROP, prePersist() and missing values

2007-04-28 Thread Marcin Skladaniec
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

vertical inheritance

2007-04-17 Thread Marcin Skladaniec
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

deleting a record and validation

2007-03-19 Thread Marcin Skladaniec
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

Re: lifecycle callbacks not always fired

2007-03-14 Thread Marcin Skladaniec
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

java docs

2007-03-05 Thread Marcin Skladaniec
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

Re: expression to find out null relationship

2007-03-03 Thread Marcin Skladaniec
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

Re: expression to find out null relationship

2007-03-02 Thread Marcin Skladaniec
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

Re: expression to find out null relationship

2007-02-27 Thread Marcin Skladaniec
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

expression to find out null relationship

2007-02-27 Thread Marcin Skladaniec
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

Re: how to call a custom query

2007-02-01 Thread Marcin Skladaniec
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

Re: deleteObject() and localObject() and object states

2007-01-29 Thread Marcin Skladaniec
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

deleteObject() and localObject() and object states

2007-01-24 Thread Marcin Skladaniec
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