Re: Truncating a table

2017-12-21 Thread Musall, Maik
gt; > The shared object cache can be cleared by finding the objects you want in > context.getGraphManager().registeredNodes() and then invalidating them one > by one. It would better to use the query cache. > > On Thu, Dec 21, 2017 at 6:48 AM Musall, Maik <m...@selbstdenker.ag>

Re: Truncating a table

2017-12-21 Thread Musall, Maik
> are various options, I'm just trying to get a feel for your use can and > thoughts. > > Thanks, > > mrg > > > On Thu, Dec 21, 2017 at 5:10 AM, Musall, Maik <m...@selbstdenker.ag> wrote: > >> Hi, >> >> I have a lookup table with >

Truncating a table

2017-12-21 Thread Musall, Maik
Hi, I have a lookup table with >400k rows that I want to periodically refill from external sources. Since it also contains precomputed values that are not part of the external source, my plan is to read the external data and batch-insert it all into the table. How can I truncate the entire

Re: Redacting db user name and password from XML

2017-12-18 Thread Musall, Maik
> Am 19.12.2017 um 06:56 schrieb Andrus Adamchik : > >> A disadvantage of this approach, though, is it puts the username/password >> on the command-line and/or the process list, plus potentially exposes it in >> command-line history, too. > > It doesn't if you are

Re: ILIKE vs. upper/lower with PostgreSQL

2017-12-16 Thread Musall, Maik
> Am 15.12.2017 um 19:49 schrieb Hugi Thordarson <h...@karlmenn.is>: > >> On 15 Dec 2017, at 16:08, Andrus Adamchik <and...@objectstyle.org> wrote: >> >>> On Dec 15, 2017, at 11:00 AM, Musall, Maik <m...@selbstdenker.ag> wrote: >>> >>

Re: ILIKE vs. upper/lower with PostgreSQL

2017-12-15 Thread Musall, Maik
.upper().like("FOO%")) > > > On Fri, Dec 15, 2017 at 11:44 AM, Musall, Maik <m...@selbstdenker.ag> wrote: >> Hi all, >> >> after migrating an EOF application to Cayenne, I noticed many queries >> running much slower than before and with more lo

ILIKE vs. upper/lower with PostgreSQL

2017-12-15 Thread Musall, Maik
Hi all, after migrating an EOF application to Cayenne, I noticed many queries running much slower than before and with more load on the database. Turns out that Cayenne generates queries using ILIKE where EOF used to generate UPPER() comparisons. Example: EOF: SELECT * FROM mytable t0

Re: Cache Groups

2017-11-08 Thread Musall, Maik
Hi Lon, have you read this? https://cayenne.apache.org/docs/4.0/cayenne-guide/performance-tuning.html#turning-off-synchronization-of-objectcontexts I added this module to

Transaction exception in concurrent environment

2017-09-21 Thread Musall, Maik
Hi, Hugi and I converted a large concurrent application from EOF to Cayenne over the last few months, and we tried taking it into production today for the first time. Mostly went fine, but we hit one problem: Exception in thread "Thread-57" org.apache.cayenne.CayenneRuntimeException:

Re: PK conflicts when inserting complex graphs

2017-08-04 Thread Musall, Maik
rder of operations or incomplete data in > duplicated inserts)? > And it really will be great if you can test your code with fewer > tables/records involved while still having failure. > > On Thu, Aug 3, 2017 at 12:22 PM, Musall, Maik <m...@selbstdenker.ag> wrote: >> H

Re: PK conflicts when inserting complex graphs

2017-08-03 Thread Musall, Maik
eritance or flattened > attributes in your model? > And maybe you can reduce number of entities involved or even better > provide some test schema on which problem occurs? > > On Wed, Aug 2, 2017 at 7:46 AM, Musall, Maik <m...@selbstdenker.ag> wrote: >> Hi, >> >> d

Re: PK conflicts when inserting complex graphs

2017-08-01 Thread Musall, Maik
Hi, does nobody have any idea? Should I post this on the dev list because it could be a Cayenne bug? Maik > Am 28.07.2017 um 17:20 schrieb Musall, Maik <m...@selbstdenker.ag>: > > Hi, > > I've been trying to resolve an unpleasant problem for a few days now. I'm >

Re: PK conflicts when inserting complex graphs

2017-07-28 Thread Musall, Maik
Forgot to mention, I'm on STABLE-4.0 using Java 8. > Am 28.07.2017 um 17:20 schrieb Musall, Maik <m...@selbstdenker.ag>: > > Hi, > > I've been trying to resolve an unpleasant problem for a few days now. I'm > trying to save a graph of new and changed objects related

PK conflicts when inserting complex graphs

2017-07-28 Thread Musall, Maik
Hi, I've been trying to resolve an unpleasant problem for a few days now. I'm trying to save a graph of new and changed objects related to each other, using a PostgreSQL 9.5 database. The number of objects is in the range between 10 and 100 usually. Several objects of the same class each, and

Re: Java 8

2017-07-27 Thread Musall, Maik
+1 > Am 27.07.2017 um 14:35 schrieb Nikita Timofeev : > > Hi all, > > There is discussion on dev@list [1], and I want to mention it here too. > The question is simple is it time to drop support for Java 7 out of > Cayenne starting from 4.1 version that is in early

Re: Ordering using non-property values

2017-07-18 Thread Musall, Maik
ing' > instead of 'customerNameForSorting' to Cayenne. Can it be a typo in the > property name? > > Andrus > >> On Jul 18, 2017, at 1:26 PM, Musall, Maik <m...@selbstdenker.ag> wrote: >> >> Yep. >> >>> Am 17.07.2017 um 17:50 schrieb Lon Varscsak &

Re: Ordering using non-property values

2017-07-18 Thread Musall, Maik
Yep. > Am 17.07.2017 um 17:50 schrieb Lon Varscsak <lon.varsc...@gmail.com>: > > Is your key “customerNameForSorting”? > > On Mon, Jul 17, 2017 at 7:40 AM, Musall, Maik <m...@selbstdenker.ag> wrote: > >> Hi John, >> >>> Am 17.07.2

Re: Ordering using non-property values

2017-07-17 Thread Musall, Maik
ould require me to re-implement the path segment tokenization and everything. Maik > On Mon, Jul 17, 2017 at 8:08 AM Musall, Maik <m...@selbstdenker.ag> wrote: > >> Hi all, >> >> I have a UI with a list of objects and user-configurable filters and >> sorting crite

Ordering using non-property values

2017-07-17 Thread Musall, Maik
Hi all, I have a UI with a list of objects and user-configurable filters and sorting criteria. Most of the sorting criteria are plain db path expressions, so I can just feed them into Ordering.orderedList(objects). A couple of them however are path expressions with the last segment being not a

ObjectSelect property return type

2017-05-04 Thread Musall, Maik
Hi, I have this query: ColumnSelect select = ObjectSelect .query( PDCMarketingInfo.class ) .where( someExpression ) .columns( PDCMarketingInfo.CUSTOMER, Property.COUNT ) .select( context ); where

Re: Validation and @PrePersist

2017-05-04 Thread Musall, Maik
n custom listeners with annotated methods are used. >> As I understand this is not a very popular usage pattern. >> >> On Thu, Apr 6, 2017 at 2:37 PM, Musall, Maik <m...@selbstdenker.ag> wrote: >>> Hi again, >>> >>> could this just have been this bug that Nik

Re: in-memory filter by Expression accessing regular methods

2017-04-16 Thread Musall, Maik
d it difficult to not name getters without the get. > > -- > Dr. Mark Wardle > Consultant Neurologist, Cardiff, UK > (Sent from my mobile) > > >> On 13 Apr 2017, at 10:44, Musall, Maik <m...@selbstdenker.ag> wrote: >> >> Hi John, >>

Re: in-memory filter by Expression accessing regular methods

2017-04-13 Thread Musall, Maik
leUser", returning another DataObject subclass. Maik > Am 12.04.2017 um 19:11 schrieb John Huss <johnth...@gmail.com>: > > Ok, you can use property utils in conjunction to call a method using > reflection (with a string name) > On Wed, Apr 12, 2017 at 6:07 PM Musall, Maik

in-memory filter by Expression accessing regular methods

2017-04-12 Thread Musall, Maik
Hi, when filtering a list of objects by expression.filterObjects( list ), is there a way for the expression to access regular methods instead of Cayenne db properties? Use Case: I have a class A that has several relationships to class B, and it depends on a number of factors which is relevant

Re: Validation and @PrePersist

2017-04-06 Thread Musall, Maik
Perhaps > past 4.0 we'll come up with some universal callback mechanism, free of JPA > heritage. > > Andrus > >> On Mar 3, 2017, at 5:13 PM, do...@xsinet.co.za wrote: >> >> Created JIRA CAY-2254 >> >> >> -Original Message---

Re: ObjectCache

2017-03-08 Thread Musall, Maik
B. > On Wed, Mar 8, 2017 at 3:01 PM Musall, Maik <m...@selbstdenker.ag> wrote: > >> Can someone confirm this? Will I always get fresh data from DB with an >> explicit query, or am I at risk being returned stale data from a >> context-local cache that doesn't even see c

Re: ObjectCache

2017-03-08 Thread Musall, Maik
with getters, then values where read > through the GraphManager from Cache. > Only OID Queries and RelationalQueries can get their data from cache. > Standard SelectQuery always runs a query on DB. But maybe I'm wrong :-/ > > Musall, Maik <m...@selbstdenker.ag> schrieb am

Re: Fetching lots of objects

2017-03-08 Thread Musall, Maik
separate > object contexts to avoid locking the same DataRow cache. > On Wed, Mar 8, 2017 at 5:59 AM Musall, Maik <m...@selbstdenker.ag> wrote: > >> >>> Am 08.03.2017 um 10:56 schrieb Aristedes Maniatis <a...@maniatis.org>: >>> >>> On 8/

Re: Fetching lots of objects

2017-03-08 Thread Musall, Maik
> Am 08.03.2017 um 10:56 schrieb Aristedes Maniatis <a...@maniatis.org>: > > On 8/3/17 6:54pm, Musall, Maik wrote: > >> regular SelectQuery: 25888 ms for 1291644 objects >> DataRowQuery alone: 14289 ms for 1291644 rows >> DataRowQuery sequential instantiati

Re: Fetching lots of objects

2017-03-07 Thread Musall, Maik
Hi Ari, > Am 07.03.2017 um 23:14 schrieb Aristedes Maniatis <a...@maniatis.org>: > > On 7/3/17 8:25am, Musall, Maik wrote: >> Hi all, >> >> I have a number of statistics functions which need to fetch large amounts of >> objects. I need the actual DataOb

Re: Fetching lots of objects

2017-03-06 Thread Musall, Maik
erator sourceIterator, boolean > parallel) { > Iterable iterable = () -> sourceIterator; > return StreamSupport.stream(iterable.spliterator(), parallel); > } > > found at > http://stackoverflow.com/questions/24511052/how-to-convert-an-iterator-to-a-stream > > br &

Fetching lots of objects

2017-03-06 Thread Musall, Maik
Hi all, I have a number of statistics functions which need to fetch large amounts of objects. I need the actual DataObjects because that's where the business logic is that I need for the computations. Let's say I need to fetch 300.000 objects. Let's also assume the database sits on a fast SSD

Re: Flattened Relationships generating empty inserts into cross table

2017-03-02 Thread Musall, Maik
nerated="true" isMandatory="true"/> > > I suspect 'isGenerated="true"'. Join table should not have auto-increment > columns. (And we may need to do a better job detecting this condition in > Cayenne). > > Andrus > > >> On Feb 23, 2

Re: Validation and @PrePersist

2017-03-02 Thread Musall, Maik
istorical behaviour > is then a bug ? That would be my conclusion, too. > It would be good for this to be changed, unless there's backward > compatibility issues :-) Well, there's no better time to change this than at the beginning of M6, right? :-) Maik > > -Original Mess

Re: Validation and @PrePersist

2017-03-01 Thread Musall, Maik
Hi Jurgen, PostAdd is fine for seting a createDate, but what about an updateDate or something similar? If these assertions are all true: 1. validation is supposed to not change attributes 2. no more changes should be made after validation happened 3. PrePersist runs after validation then there

Re: Validation and @PrePersist

2017-03-01 Thread Musall, Maik
Hi all, but isn't hte purpose of validation to check if the object to be saved is in a valid state? That would imply that validation has a positive (pass) or negative (ValidationException) result, and no side effects. Modifying the object during validation would defeat the purpose, wouldn't

Re: ObjectCache

2017-02-24 Thread Musall, Maik
sume the objects will be refreshed when I need). > > -Lon > > On Fri, Feb 24, 2017 at 3:00 AM, Musall, Maik <m...@selbstdenker.ag> wrote: > >> Hi all, >> >> I'd like to extend this question a bit. I just read the entire performance >> tuning chap

Re: ObjectCache

2017-02-24 Thread Musall, Maik
Hi all, I'd like to extend this question a bit. I just read the entire performance tuning chapter again [1], and I'm a bit puzzled especially about the ObjectContext's local caches, which Andrus also recommended to use in the "A way to refreshObject()" thread: > So instead of

Re: CommitChangesToParent() <> CommitChanges()

2017-02-23 Thread Musall, Maik
n verifiy is that when you commit sthg to a context, the child > contexts gets synched immediatetly, when committing in childContext the > change is also immediately visible in the parent context, but in other > existing contexts. > > As I see my testcase was not very usef

Re: CommitChangesToParent() <> CommitChanges()

2017-02-23 Thread Musall, Maik
Hi Markus, > I'm having some troubles understanding commitChanges() and > commitChangesToParent() :-/ > > I've created a test case with two ObjectContexts > ObjectContext context1 = runtime.newContext(); > ObjectContext context2 = runtime.newContext(); Those two don't have a parent/child

Flattened Relationships generating empty inserts into cross table

2017-02-22 Thread Musall, Maik
Hi, I have an m:n relationship that works fine on queries but generates an empty insert when adding entries. Table 1: PDCUserRole Table 2: PDCUserRight x-Table: PDCUserRolePDCUserRight Here are the relevant parts of my map.xml:

Re: A way to refreshObject()

2017-02-22 Thread Musall, Maik
> Am 22.02.2017 um 19:39 schrieb Andrus Adamchik <and...@objectstyle.org>: > > >> On Feb 22, 2017, at 6:55 PM, Musall, Maik <m...@selbstdenker.ag> wrote: >> >> Hi Andrus, >> >> ok, setting PersistenceState.HOLLOW works. So easy :-) >

Re: A way to refreshObject()

2017-02-22 Thread Musall, Maik
argument above :). But yeah, you can > turn context syncing back on, and get auto-synchronization. So when you set > Constants.SERVER_CONTEXTS_SYNC_PROPERTY to true (or rather don't set it to > false), does it handle the refreshing the way that you want? > > Andrus > > >> On Feb 22, 2017, at 4:02 PM

Re: Creating a fault for an ObjectId

2017-02-22 Thread Musall, Maik
ect objects from multiple contexts in a single > resulting context, you may use this: > > context.localObject(objectFromAnotherContext) > > (I don't think anyone has mentioned "localObject" in this thread ??) > > Andrus > > >> On Feb 15, 2017, at 7:1

Re: A way to refreshObject()

2017-02-22 Thread Musall, Maik
bove (which we probably > should change) > myObject.setObjectId(id); > > // get a fresh fault > myObject = context.localObject(myObject); > > Andrus > > >> On Feb 21, 2017, at 11:54 PM, Musall, Maik <m...@selbstdenker.ag> wrote: >>

A way to refreshObject()

2017-02-21 Thread Musall, Maik
Hi all, I have an application using a big shared snapshot cache. Objects freshly instantiated in an ObjectContext get their attributes populated based on the snapshot cache at the time, and keep them during the context's lifetime, which is also what I want. (Last week I found a page on

Re: Switching SQL logging on/off at runtime

2017-02-17 Thread Musall, Maik
l of our applications is > the ability to set logger levels at runtime (not just Cayenne, but any of > them). Allows us to have a "reasonable" default most of the time, > especially in production, but then be able to change dynamically if we need > to troubleshoot. > > mrg > &

Re: Switching SQL logging on/off at runtime

2017-02-16 Thread Musall, Maik
Of course, thanks. Works! > Am 16.02.2017 um 21:22 schrieb John Huss <johnth...@gmail.com>: > > Use the log4j api. Something like RootLogger.getLogger("org.apache.cayenn > e.access.QueryLogger").setLevel(Level.INFO) > > On Thu, Feb 16, 2017 at 2:53 PM Musall,

Switching SQL logging on/off at runtime

2017-02-16 Thread Musall, Maik
Hi all, like recommended in https://cayenne.apache.org/docs/3.0/configuring-logging.html, I use these properties to control the logging of SQL: log4j.logger.org.apache.cayenne.access.QueryLogger = WARN log4j.logger.org.apache.cayenne = WARN How would I switch SQL logging on from within the

Re: Creating a fault for an ObjectId

2017-02-15 Thread Musall, Maik
The use case is as follows. I have a large collection of objects which I want some function to be executed on. I want to use multiple threads to do this, so AFAIK I have to use separate ObjectContexts per thread like in EOF. So, I will then instantiate those objects in the per-thread contexts,

Re: Cayenne and migrations

2017-02-10 Thread Musall, Maik
; >>>> I pushed the changes I had pending - there was more than I thought. >>>> >>>> I'm fine with it going in, but I'm not sure that the community agrees. >>>> Since this can live as an independent project / jar there isn't really a >>>&g

Re: Cayenne and migrations

2017-02-09 Thread Musall, Maik
Hi John, how do you (and everyone else) feel about including this in the main repo after polishing? I'm working with Hugi here on a project and would like to continue using this style of migrations because our entire environment is geared towards it. I'd love for this to be in the main