Re: Cayenne 3.0.2 artifacts 

2023-08-26 Thread Mike Kienenberger
Oh, that's not so old. I'm actively maintaining an app using Cayenne 1.2 (modified, so it's pretty difficult to upgrade). And foundrylogic.vpp:vpp:jar:2.2.1 is available, just not in maven central. https://mvnrepository.com/artifact/foundrylogic.vpp/vpp/2.2.1 Also, if you don't want to use

Re: use Date values in ExpressionFactory.exp

2021-01-02 Thread Mike Kienenberger
Oracle expects SQL like the following to compare dates. MODIFIED_DATE > TO_DATE('2003-07-17','-mm-dd') You either need to use that in your exp() method, or use greaterExp(), which can automatically generate the needed sql for the current database. Date date = new

Re: In memory DB for unit testing

2018-05-03 Thread Mike Kienenberger
lt than using helper classes to create default data sets. >> >> Bootique tools support both types of datasets: file- and API-based, e.g. >> [1]. And fwiw I personally hate both of them :) >> >> Andrus >> >> [1] >> https://github.com/bootique/bootique-

Re: In memory DB for unit testing

2018-05-03 Thread Mike Kienenberger
As a general observation after using dbunit for 13 years, I've found that maintaining tests using standalone data files is far more difficult than using helper classes to create default data sets. I ended up with far too many data sets, and things were even worse if I needed a test with many

Re: In memory DB for unit testing

2018-05-02 Thread Mike Kienenberger
The reason I went with having the db entirely in memory was to run tests in parallel. Once you have a disk presence, you'll have to worry about test collisions. On Wed, May 2, 2018 at 5:35 PM, Michael Gentry wrote: > Hi Ken, > > To add to what Mike said, I've used H2 in the

Re: In memory DB for unit testing

2018-05-02 Thread Mike Kienenberger
I use hsqld and dbunit with Cayenne to run my unit and integration tests. Nothing specific comes to mind. General things I did were to use cgen to generate dbunit classes for programmically populating the database tables (external to cayenne) and making sure my tests didn't exceed the

Re: Staged saves pattern ?

2018-04-01 Thread Mike Kienenberger
ut that’s a decent amount of > work for the 8 or so entities that I might work with, and gets even more > complicated when I start to deal with the chance a fault will be fired. > >> On Mar 29, 2018, at 6:39 PM, Mike Kienenberger <mkien...@gmail.com> wrote: >> >> I

Re: Staged saves pattern ?

2018-03-29 Thread Mike Kienenberger
cant graph of objects, and relationships could fire at different > levels. > > Thanks for your thoughts! > >> On Mar 29, 2018, at 6:07 PM, Mike Kienenberger <mkien...@gmail.com> wrote: >> >> Like I said, I haven't used nested contexts, but I'm assuming that >>

Re: Staged saves pattern ?

2018-03-29 Thread Mike Kienenberger
t; The docs say to not go too deep with nested contexts, so I don't think that's > a viable solution. I'm also not clear what benefit you think this would have > over the 2 level plan. > > Ken > > On 3/29/18, 5:39 PM, "Mike Kienenberger" <mkien...@gmail.com> wrot

Re: Staged saves pattern ?

2018-03-29 Thread Mike Kienenberger
Instead of having each line as a child context under a parent context, parent - child1 (line 1) - child2 (line 2) - child3 (line 3) could you have each line processed as a child context of the previous line? - child1 (line 1) -- child2 (line 2) --- child3 (line 3) child4 (line 4) If you

Re: a jdk question

2018-01-26 Thread Mike Kienenberger
I've been running 3.1 under Java 8 in production for years. On Fri, Jan 26, 2018 at 12:42 AM, Andrus Adamchik wrote: > Hi there, > > Yes, 3.1 should work on Java 8. > > Cheers, > Andrus > > >> On Jan 26, 2018, at 7:45 AM, zheng yan wrote: >> >>

Re: Redacting db user name and password from XML

2017-12-18 Thread Mike Kienenberger
This is from my Cayenne 3.x project, but it's probably the same for 4.x. Create your own DataSourceFactory class and use it to provide username and password values. == public class ConfigFilePoolingDataSourceFactory implements DataSourceFactory { private static

Re: Cayenne advantages

2017-10-09 Thread Mike Kienenberger
Well, I'm still on Cayenne 3, but the number one thing for me is ObjectContext. -- ObjectContext unit of work: Distinct scratch areas where a set of changes are proposed, but can be thrown away with no effort, or committed to the database if kept -- all without ongoing open active database

Re: Question on how to properly create parent-child nested dependent objects?

2017-09-20 Thread Mike Kienenberger
r making the >> coder of the parent object worry about creating child objects first. >> >> >> >> On 20/09/17 08:45 AM, Nikita Timofeev wrote: >> >>> Other option is to create CommunicationType first and then just use it: >>> >>> Communicatio

Re: Question on how to properly create parent-child nested dependent objects?

2017-09-20 Thread Mike Kienenberger
ommit CommunicationType to DB. > > On Wed, Sep 20, 2017 at 3:37 PM, Mike Kienenberger <mkien...@gmail.com> wrote: >> I haven't followed the details, so I don't know if using a separate >> object context is necessary, but all you need to do to move a data >> object (in yo

Re: Question on how to properly create parent-child nested dependent objects?

2017-09-20 Thread Mike Kienenberger
I haven't followed the details, so I don't know if using a separate object context is necessary, but all you need to do to move a data object (in your case "child") to a different context is to call parentContext.localObject(childDataObject) which will return childDataObjectInParentContext. Note

Re: PK conflicts when inserting complex graphs

2017-08-04 Thread Mike Kienenberger
You do need to make sure that the database's sequence "Increment by" value matches Cayenne's expected sequence increment (m). You have to pick the same value to use in both places. On Fri, Aug 4, 2017 at 11:26 AM, Musall, Maik wrote: > I think I've found the main reason

Re: Poorly modeled to-one relationship help

2017-04-17 Thread Mike Kienenberger
Set the as "toDep PK" property as true for the db relationship from cost to cost_ext_info for the COST DbEntity. https://www.google.com/search?q=cayenne+dependent+primary+key On Mon, Apr 17, 2017 at 12:11 PM, Ken Anderson wrote: > All, > > > > We have a situation

Re: Improper capitalization in StringUtils.capitalizedAsConstant()

2017-02-14 Thread Mike Kienenberger
There's no reason why another method couldn't be added. StringUtils was originally just a list of methods I found helpful. StringUtils is a POJO (plain old java object) inserted into the velocity context. You can add other objects with your own custom functions:

Re: How to fire multiple sql statements as one transaction.

2016-12-27 Thread Mike Kienenberger
sure it's all working as expected. On Tue, Dec 27, 2016 at 12:29 PM, Kumar <kumar9885035...@gmail.com> wrote: > OK. Let me try. But can we rollback if there is a failure? > > On Tue, Dec 27, 2016 at 10:54 PM, Mike Kienenberger <mkien...@gmail.com> > wrote: > >>

Re: How to fire multiple sql statements as one transaction.

2016-12-27 Thread Mike Kienenberger
il.com> wrote: > I'm using 4.0 and have gone through those docs but couldn't find what i > need. Can you please help me out? I just want to fire multiple native sql > statements using (SQLExce). > > On Tue, Dec 27, 2016 at 8:53 PM, Mike Kienenberger <mkien...@gmail.com> >

Re: How to fire multiple sql statements as one transaction.

2016-12-27 Thread Mike Kienenberger
I don't remember what version of Apache Cayenne you are using, but you can find the documentation on transactions at these two URLs. https://cayenne.apache.org/docs/3.0/understanding-transactions.html

Re: Set DB Adapter in code

2016-10-19 Thread Mike Kienenberger
The way I set up for testing to use a different config xml file pointing to my in-memory hsqldb nodes and pass it to the ServerRuntime constructor. On Tue, Oct 18, 2016 at 1:44 PM, John Huss wrote: > Hmmm, not sure. Another option is to define both nodes in CayenneModeler >

Re: Conversion error:

2016-07-11 Thread Mike Kienenberger
Do you get the same error using non-cayenne java code while reading the field? On Mon, Jul 11, 2016 at 6:56 PM, Tony Giaccone wrote: > I'm using the H2 database and have a field that's a timestamp, > > > I get this message on trying to read the field with Cayenne: > > >

Re: Batch Fetch

2016-07-05 Thread Mike Kienenberger
That'd be something I'd get some use out of as well. On Tue, Jul 5, 2016 at 5:19 PM, Lon Varscsak wrote: > I know I’ve asked this before, but I need a batch fetch utility class, to > trigger batch fetching of relationships. I know pre-fetching will do this, > but usually

Re: How to execute a stored procedure as part of a commitChanges?

2016-04-11 Thread Mike Kienenberger
See the bottom part of this page starting at "In the second scenario": https://cayenne.apache.org/docs/4.0/cayenne-guide/persistent-objects-objectcontext.html#transactions On Mon, Apr 11, 2016 at 10:54 AM, Juan Manuel Diaz Lara wrote: > > > I have a dataobjet graph

Re: No object is registered in context with Id

2016-03-04 Thread Mike Kienenberger
Objects never belong to any context other than the one that created them. When you call n = c2.localObject(o), o still exists in the original context c1, but a new n is created for context c2. Unless c1 = c2 in which case o = n. Note that you need to be careful calling localObject on an

Re: Cayenne 3.1 - Error using cgen ant task

2016-01-26 Thread Mike Kienenberger
It's probably a classpath issue with your taskdef. For instance, this is what mine looks like: On Tue, Jan 26, 2016 at 1:03 PM, Frank Herrmann

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Mike Kienenberger
I remember that happening to me way back in Cayenne 1.x when I converted over from EOF.I wonder if there's any way we can make this more obvious to the end-user who migrates from EOF? Hugi, was there any particular place where we could have documented this where it would have become obvious

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Mike Kienenberger
We are willing to support older obsolete versions of databases as well as new ones. :) Our Oracle driver code is an example of how we support multiple driver versions. On Tue, Oct 13, 2015 at 11:16 AM, Hugi Thordarson wrote: > I’m not sure how useful my work would be since

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Mike Kienenberger
ion be submitted as a pull request like everything > else? > > But even better would be if JdbcPkGenerator would warn the user if a DB > generated PK doesn’t match what it expects once the PK cache has been > exhausted. > > Cheers, > - hugi > > > >> On 13.

Re: CayenneModeler not generating classes

2015-10-12 Thread Mike Kienenberger
e 38 containing: #if((${object.DeclaredAttributes} && !${object.DeclaredAttributes.isEmpty()}) || (${object.DeclaredRelationships} && !${object.DeclaredRelationships.isEmpty()})) On Fri, Oct 9, 2015 at 9:26 AM, Mike Kienenberger <mkien...@gmail.com> wrote: > The three thi

Re: likeIgnoreCase queries and EJBQL

2015-10-12 Thread Mike Kienenberger
Sounds like the DbAdaptor for that database needs to be special-cased. Lots of examples of how this is done in cayenne/dba//*, especially for oracle And it's pretty simple to set your app up to use a custom version of the dbAdaptor if you don't want to build your own custom version of cayenne

Re: CayenneModeler not generating classes

2015-10-09 Thread Mike Kienenberger
The three things needed to track this down are: 1) The version of velocity you are using -- it looks like the pom.xml file asks for 1.6.3, but there are at least two newer versions of velocity that something else might be requesting instead. 2) The template you use using when you get the error.

Re: Reading boolean values stored in a database as chars

2015-10-07 Thread Mike Kienenberger
Or sometimes it's easier to use a custom template and generate additional methods that automatically convert between String and boolean values. On Wed, Oct 7, 2015 at 3:08 PM, John Huss wrote: > Check out the code for org.apache.cayenne.access.types.BooleanType and it's >

Re: Is there a canonical method of invoking aggregate functions

2015-09-14 Thread Mike Kienenberger
There's a lot of ex-EOF/ex-WO folks involved with this project (including me). Do we still have the model converter out there? When I started using Cayenne back in the 1.1 days, we had a converter tool that would create a cayenne project out of an EOF project. I'm not sure if it's still around

Re: Obtain primary key for DataObject before commitChanges

2015-08-12 Thread Mike Kienenberger
On Tue, Aug 11, 2015 at 8:49 PM, Aristedes Maniatis a...@maniatis.org wrote: I'm interested in a different part of the problem you are solving. Other than the relationship data discuss here, how are you storing the actual changes in your audit table? Does your problem just require Bob changed

Re: Obtain primary key for DataObject before commitChanges

2015-08-10 Thread Mike Kienenberger
to be reusable with any Cayenne installation so can’t depend on superclass template modifications), it’s very helpful to see code from other Cayenne folks. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 10. ágú. 2015, at 12:53, Mike

Re: Obtain primary key for DataObject before commitChanges

2015-08-10 Thread Mike Kienenberger
I set up auditing using a different approach in one project many years ago back in Cayenne 1.1, and I've continued using it up to this point in 3.x. I generated special setter, addTo, and removeFrom methods as well as a create method which created the logger object at that point. To get the

Re: Prefetching all child nodes in a tree

2015-08-08 Thread Mike Kienenberger
I'm pretty sure you said you were using Oracle so you might be better off using an SQLTemplate with oracle-specific code to pull in all of these objects in one query, particularly if there might be a large number of them. There's a bunch of different ways to do it, and I don't have direct access

Re: Prefetching all child nodes in a tree

2015-08-08 Thread Mike Kienenberger
Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 8. ágú. 2015, at 14:43, Mike Kienenberger mkien...@gmail.com wrote: I'm pretty sure you said you were using Oracle so you might be better off using an SQLTemplate with oracle-specific code to pull in all of these objects

Re: java.sql.SQLException: Can't obtain connection. Request timed out.

2015-07-31 Thread Mike Kienenberger
) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) [Start of the thread above] On Fri, Jun 12, 2015 at 11:21 AM, Mike Kienenberger mkien...@gmail.com wrote: Hmm. I just remembered that I have a second

Re: java.sql.SQLException: Can't obtain connection. Request timed out.

2015-07-31 Thread Mike Kienenberger
guess the real surprise is that it works as well as it does with only 3 database connections in the pool. I'll raise that up to 5-to-10 and probably be good for another decade :) Thanks for the hints, Andrus. On Fri, Jun 12, 2015 at 11:21 AM, Mike Kienenberger mkien...@gmail.com wrote: Hmm. I

Re: java.sql.SQLException: Can't obtain connection. Request timed out.

2015-07-31 Thread Mike Kienenberger
Oops. Stupid user error. My thread dumper method was dumping each thread trace as many times as there were lines in the thread trace. So a 65-line trace created 65 copies... What a mess I've made. On Fri, Jul 31, 2015 at 5:01 PM, Mike Kienenberger mkien...@gmail.com wrote: ] So I'm

Re: Version API

2015-07-29 Thread Mike Kienenberger
of object.getClass() or you can set object to new CayenneRuntimeException() On Mon, Jul 27, 2015 at 10:41 AM, Mike Kienenberger mkien...@gmail.com wrote: Our jar MANIFEST file also contains: Bundle-Version: 4.0.0.M2 But shouldn't we also be supplying this information as Implementation-Version

Re: Version API

2015-07-27 Thread Mike Kienenberger
Our jar MANIFEST file also contains: Bundle-Version: 4.0.0.M2 But shouldn't we also be supplying this information as Implementation-Version: 4.0.0.M2 so it's in a standardized place? I'd guess that's a simple maven build change -- I know how to do it under ant, but not under maven. Once we

Re: Expression to look for objects with an empty to-many relationship?

2015-07-24 Thread Mike Kienenberger
It''s been a long time since I've done this (years, Cayenne 1.2 with outer join support), but I seem to recall being about to do this with a ExpressionFactory.matchExp(path, null). Like Andrus said, you might need to add a + in there to force an outer join. Sorry I can't be of more help. It

Re: Trouble with Web app deployment

2015-06-12 Thread Mike Kienenberger
On 06/12/2015 10:27 AM, Mike Kienenberger wrote: So you will need 2.4, 2.5, or 2.6 (2.4 is the safest if you have no other commons-lang 2.x dependencies). On Fri, Jun 12, 2015 at 12:02 PM, Andrew Willerding awillerd...@itsurcom.com wrote: I added apache commons-lang3-3.4 to the project

Re: java.sql.SQLException: Can't obtain connection. Request timed out.

2015-06-12 Thread Mike Kienenberger
And upping my connection pool size from 1 to 3 didn't help as I got the error again today, but this time with all 3 in use. Caused by: java.sql.SQLException: Can't obtain connection. Request timed out. Total used connections: 3 On Thu, Jun 11, 2015 at 11:41 AM, Mike Kienenberger mkien

Re: java.sql.SQLException: Can't obtain connection. Request timed out.

2015-06-12 Thread Mike Kienenberger
hasn't needed it yet? On Fri, Jun 12, 2015 at 10:56 AM, Andrus Adamchik and...@objectstyle.org wrote: So there's a leak somewhere. Do you see any hanging threads with jstack, or maybe some unclosed ResultIterators? Andrus On Jun 12, 2015, at 5:51 PM, Mike Kienenberger mkien...@gmail.com

Re: Trouble with Web app deployment

2015-06-12 Thread Mike Kienenberger
On Fri, Jun 12, 2015 at 9:40 AM, Andrew Willerding awillerd...@itsurcom.com wrote: app. When I attempt to start Tomcat and load my app I'm getting the Which version of tomcat? Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils Which commons lang version? And

Re: Trouble with Web app deployment

2015-06-12 Thread Mike Kienenberger
On Fri, Jun 12, 2015 at 10:20 AM, Andrew Willerding awillerd...@itsurcom.com wrote: Which commons lang version? I'm including the one bundled with Cayenne - commons-collections-3.2.1 That's not a commons-lang library. That's commons-collections. I took a quick peek at the cayenne binary

Re: java.sql.SQLException: Can't obtain connection. Request timed out.

2015-06-11 Thread Mike Kienenberger
11, 2015, at 6:18 PM, Mike Kienenberger mkien...@gmail.com wrote: So I finally put my old Cayenne 1.x-upgraded to 3.x app into production. A couple of hours later, I got this error [1]. Note that my app synchronizes requests so only one thread should ever be running Cayenne requests

java.sql.SQLException: Can't obtain connection. Request timed out.

2015-06-11 Thread Mike Kienenberger
So I finally put my old Cayenne 1.x-upgraded to 3.x app into production. A couple of hours later, I got this error [1]. Note that my app synchronizes requests so only one thread should ever be running Cayenne requests at a time. My app has run for years with only a single connection. My 3.x

Re: Cayenne design Patterns

2015-06-08 Thread Mike Kienenberger
I tend to use a DAO pattern in projects where I want all cayenne references isolated to a specific package. I use the template generator to create 90%of the code and keep it up to date On Mon, Jun 8, 2015 at 9:48 AM, Gmail tgiacc...@gmail.com wrote: I'm wondering how people on this mailing

Re: Sharing a database with EOF: Primary key generation

2015-05-22 Thread Mike Kienenberger
On Fri, May 22, 2015 at 9:46 AM, Mike Kienenberger mkien...@gmail.com wrote: Hugi, it would be worthwhile to make this a customizable parameter in the existing primary key generator rather than only creating your own custom version. I also haven't looked at that part of the code base

Re: Sharing a database with EOF: Primary key generation

2015-05-22 Thread Mike Kienenberger
Hugi, it would be worthwhile to make this a customizable parameter in the existing primary key generator rather than only creating your own custom version. I also haven't looked at that part of the code base in a long while so I don't know how feasible this is. On Fri, May 22, 2015 at 7:15 AM,

Re: Cayenne 4.0 and logging

2015-05-11 Thread Mike Kienenberger
You could also look at slf4j for your bridging software. http://www.slf4j.org/legacy.html with log4j-over-slf4.jar convering old log4j version 1 api calls into slf4j calls. From there you can log to whatever you like. Same with old JCL calls. On Mon, May 11, 2015 at 10:24 AM, Aristedes

Re: a setter for addToManyTarget ?

2014-12-16 Thread Mike Kienenberger
Jurgen described the correct process if you want to make this change for all entities. I generally use ant to generate my custom templates. If you only want it for a single relationship, just add the method to your entity subclass directly. For set*(), I'm pretty sure you're going to want to

Re: spark or dropwizard ?

2014-11-29 Thread Mike Kienenberger
The general way it is done for j2ee apps is to create the ObjectContext in either a request attribute or a ThreadLocal at the start of the request and remove it at the end of the request. Lots of ways to do it, though. I also tend to check for a dirty ObjectContext in the removal part to insure

Re: Class generation in 3.2.M2-SNAPSHOT

2014-10-28 Thread Mike Kienenberger
Back in Cayenne 1.2/2.0, there was a way to specify additional datamaps in cgen. Maybe that's what's missing for you now, although I don't know for certain. On Tue, Oct 28, 2014 at 7:59 PM, Lon Varscsak lon.varsc...@gmail.com wrote: There appears to be an issue either with class generation or

Re: Default values in DB

2014-06-13 Thread Mike Kienenberger
Here are some previous discussions on default values, from most current to ancient. I don't know if this is a complete list. DB default values http://mail-archives.apache.org/mod_mbox/cayenne-user/201309.mbox/%3ccagscxrykqbpmm+kbmxhbgag3+uvnfct-xqe6bhtqpaaqnxv...@mail.gmail.com%3E default value

Re: How to use JNDI in development

2014-04-25 Thread Mike Kienenberger
I started with Eclipse using Tomcat and Sysdao. I did this for a year or two before switching over to jetty. At first I used a jetty eclipse plugin, but for the last few years, I have switched over to just configuring jetty by hand in an xml file, adding jetty to the project as user library,

Re: How to use JNDI in development

2014-04-25 Thread Mike Kienenberger
On Fri, Apr 25, 2014 at 7:27 PM, D Tim Cummings t...@triptera.com.au wrote: I am certainly finding jetty easier than tomcat in eclipse and once I get more familiar with it I may recommend it for production. I am a bit concerned at all the different versions of jetty floating around with so

Re: 3.2 support for vertical inheritance and query flushing?

2014-04-01 Thread Mike Kienenberger
On Tue, Apr 1, 2014 at 5:54 AM, Andrus Adamchik and...@objectstyle.org wrote: I don't think we've ever used the term flushing, so Google won't show it. But transaction control is definitely there. If I understand this correctly (and translating to Cayenne terms), you need a way to have an

3.2 support for vertical inheritance and query flushing?

2014-03-21 Thread Mike Kienenberger
My primary client is once again considering switching from JPA to Cayenne. The last time this was brought up back in 2010, the lack of full vertical inheritance support was an issue, and there was also the question of handling JPA flush calls. When I looked at the 3.0 docs, it seems like we now

Re: DBCPDataSourceFactory

2014-03-12 Thread Mike Kienenberger
According to this http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/BasicDataSourceExample.java?view=markup BasicDataSource ds = new BasicDataSource(); ds.setUsername(scott); ds.setPassword(tiger); On Wed, Mar 12, 2014 at 5:01 AM, do...@xsinet.co.za wrote: Hi All I've

Re: DBCPDataSourceFactory

2014-03-12 Thread Mike Kienenberger
); ds.setPassword(tiger); // set other options etc. binder.bind( BasicDataSource.class ).toInstance( ds ); } So the question is if I manually configure a DBCP Data Source how do I pass then pass on to Cayenne ? Thanks, regards Jurgen -Original Message- From: Mike

Re: DBCPDataSourceFactory

2014-03-12 Thread Mike Kienenberger
at it and see. Thanks, regards Jurgen -Original Message- From: Mike Kienenberger Sent: Wednesday, March 12, 2014 6:41 PM To: user@cayenne.apache.org Subject: Re: DBCPDataSourceFactory I'm not an expert on this, but I'd set those values when I created the Data Source. For my

Re: Setting the Transaction Isolation Level

2014-03-11 Thread Mike Kienenberger
For what it's worth, I configure my pool manager in Cayenne 3.1 via a factory in the cayenne.xml file: node name=SomeNode factory=com.xyz.cayenne.ConfigFilePoolingDataSourceFactory On Tue, Mar 11, 2014 at 2:00 PM, do...@xsinet.co.za wrote: Thanks Laurent I understand the

Re: Selecting against postgres sequence

2014-01-08 Thread Mike Kienenberger
Well, it's trying to convert your returned sequence result into an EdiProfile object. Is that compatible? It might make more sense to read the sequence as a data row -- setFetchingDataRows(true); Here's code I used to fetch a sequence number (from an old Cayenne 2.0 project, so some things may

Re: cayenne library changes log level in struts2

2013-12-03 Thread Mike Kienenberger
Everyone has their favorite logger. The commons logging api is supported by all of them, sometimes without even needing the actual commons logging jars, as I'm sure you already know. :-) On Tue, Dec 3, 2013 at 8:45 AM, Christian Grobmeier grobme...@gmail.com wrote: Commons Logging?? Have you

Re: cayenne library changes log level in struts2

2013-12-03 Thread Mike Kienenberger
for their own applications. On Tue, Dec 3, 2013 at 9:30 AM, Christian Grobmeier grobme...@gmail.com wrote: On 3 Dec 2013, at 14:52, Mike Kienenberger wrote: Everyone has their favorite logger. The commons logging api is supported by all of them, sometimes without even needing the actual commons

Re: cayenne library changes log level in struts2

2013-12-03 Thread Mike Kienenberger
On Tue, Dec 3, 2013 at 12:39 PM, Christian Grobmeier grobme...@gmail.com wrote: I hope this was rethoric and you don't consider my emails trollish? Thats not the intention. I am involved in Apache Commons and in Apache Logging and logging is some kind of a natural interest. If you feel that my

Re: Removing use shared cache option

2013-11-04 Thread Mike Kienenberger
I was considering unchecking it to force every session of my web application to work with its own set of records from the database. On Mon, Nov 4, 2013 at 2:16 AM, Aristedes Maniatis a...@maniatis.org wrote: We experimented with that option and unticking it caused expected behaviour that was

Re: Removing use shared cache option

2013-11-04 Thread Mike Kienenberger
On Mon, Nov 4, 2013 at 9:32 AM, Andrus Adamchik and...@objectstyle.org wrote: Yes, this depends on configuration of your stack. JNDIDataSourceFactory will result in a shared connection pool (provided by container). XMLPoolingDataSourceFactory will not. I was using

Re: 3.0 - 3.1: Committed changes not propagating to other contexts / invalidating objects not removing cached values

2013-11-04 Thread Mike Kienenberger
); this.response = response; On Mon, Nov 4, 2013 at 10:48 AM, Mike Kienenberger mkien...@gmail.com wrote: I reran my tests, and, yes, the invalidateObjects is failing because I had sharedCacheEnabled set to false. (I had set it in my java code rather than in the model, so

Re: Removing use shared cache option

2013-11-04 Thread Mike Kienenberger
On Mon, Nov 4, 2013 at 2:16 AM, Aristedes Maniatis a...@maniatis.org wrote: We experimented with that option and unticking it caused expected behaviour that was quite hard to understand. Particularly in how it inter-related to the object cache. Dima is the person who knows all the details of

Re: 3.0 - 3.1: Committed changes not propagating to other contexts / invalidating objects not removing cached values

2013-11-04 Thread Mike Kienenberger
GenericResponse(); response.addUpdateCount(1); this.response = response; On Mon, Nov 4, 2013 at 10:48 AM, Mike Kienenberger mkien...@gmail.com wrote: I reran my tests, and, yes, the invalidateObjects is failing because I had sharedCacheEnabled set to false. (I

Re: 3.0 - 3.1: Committed changes not propagating to other contexts / invalidating objects not removing cached values

2013-09-27 Thread Mike Kienenberger
at 9:50 AM, Mike Kienenberger mkien...@gmail.com wrote: On Tue, Sep 24, 2013 at 2:15 AM, Andrus Adamchik and...@objectstyle.org wrote: Could be because peer context notifications are now asynchronous and you test runs before the change is propagated? Async context synchronization is used

Re: No willPerform(Generic)Query support for prefetching queries in 3.1?

2013-09-26 Thread Mike Kienenberger
to be generating correct prefetching query qualifiers. On Tue, Sep 24, 2013 at 4:16 PM, Mike Kienenberger mkien...@gmail.com wrote: Added as Issue CAY-1875 - PrefetchSelectQuery incorrectly applies entity qualifiers On Tue, Sep 24, 2013 at 1:48 PM, Andrus Adamchik and...@objectstyle.org wrote: From what

Re: 3.0 - 3.1: Committed changes not propagating to other contexts / invalidating objects not removing cached values

2013-09-24 Thread Mike Kienenberger
JavaGroups, JMS, and XMPP bridge factory implementations in the 3.1 source, all of which require third-party libraries. Is a 3rd-party package required for this to work as advertised? On Sep 23, 2013, at 11:10 PM, Mike Kienenberger mkien...@gmail.com wrote: Under 3.0.2, I have a test

Re: No willPerform(Generic)Query support for prefetching queries in 3.1?

2013-09-24 Thread Mike Kienenberger
) { return new MockQueryEngine(); } + +public Query willPerformQuery(PrefetchSelectQuery prefetchQuery) { +return prefetchQuery; +} } On Mon, Sep 23, 2013 at 7:04 PM, Mike Kienenberger mkien...@gmail.com wrote: All of my tests pass now, but I'm still hitting a few issues for 3.1

Re: No willPerform(Generic)Query support for prefetching queries in 3.1?

2013-09-24 Thread Mike Kienenberger
add a qualifier to affected entities in the Modeler. Andrus On Sep 24, 2013, at 7:00 PM, Mike Kienenberger mkien...@gmail.com wrote: Here's one possible way to add support for intercepting prefetch queries. I'm not entirely certain it's the best way, but I didn't see another obvious point

3.0 - 3.1: Committed changes not propagating to other contexts / invalidating objects not removing cached values

2013-09-23 Thread Mike Kienenberger
Under 3.0.2, I have a test that creates a local copy of an object in a new DataContext, makes a change to it, commits the change, and then verifies that both the old copy and the new copy match. And this passes. Under 3.1, the old object does not reflect the new changes, although the 3.x docs

Upgrading from 3.0

2013-09-20 Thread Mike Kienenberger
So I'm looking at upgrading from 3.0.2 to 3.1 or 3.2. I can already see that there's a lot of Configuration-related changes I am going to have to make. Is it easier to upgrade to 3.1 then 3.2, or from 3.0.2 to 3.2 directly? The 3.2M1 package does not contain upgrade notes for 3.2, but only up

Re: Upgrading from 1.1/1.2/2.0 DataContext.WILL_COMMIT to 3.x

2013-09-16 Thread Mike Kienenberger
/cayenne/DataChannelFilter.html [2] http://cayenne.apache.org/docs/3.1/cayenne-guide/lifecycle-events.html#comining-listeners-with-datachannelfilters On Sep 13, 2013, at 9:32 PM, Mike Kienenberger mkien...@gmail.com wrote: So I'm finally making the attempt to upgrade my ancient Cayenne project

Re: Upgrading from 1.1/1.2/2.0 DataContext.WILL_COMMIT to 3.x

2013-09-14 Thread Mike Kienenberger
Further testing shows that GRAPH_FLUSHED_SUBJECT would be DID_COMMIT not WILL_COMMIT. So I'm still unable to get a single one-time notification before a DataContext will commit a transaction. On Fri, Sep 13, 2013 at 2:39 PM, Mike Kienenberger mkien...@gmail.com wrote: So right after I sent my

Upgrading from 1.1/1.2/2.0 DataContext.WILL_COMMIT to 3.x

2013-09-13 Thread Mike Kienenberger
So I'm finally making the attempt to upgrade my ancient Cayenne project from 1.1 to 3.x. The one kind of compile error I still haven't resolved is registering for a data context commit. I know I can register individual PrePersist, PreRemove, and PreUpdate callbacks for individual entity types,

Re: Upgrading from 1.1/1.2/2.0 DataContext.WILL_COMMIT to 3.x

2013-09-13 Thread Mike Kienenberger
event? On Fri, Sep 13, 2013 at 2:32 PM, Mike Kienenberger mkien...@gmail.com wrote: So I'm finally making the attempt to upgrade my ancient Cayenne project from 1.1 to 3.x. The one kind of compile error I still haven't resolved is registering for a data context commit. I know I can register

Re: Optimistic Locking

2013-09-13 Thread Mike Kienenberger
On Fri, Sep 13, 2013 at 3:56 AM, Markus Reich markus.re...@markusreich.at wrote: is there a possibility to disalbe optimistic locking for certain entites in runtime?` e.g. the user get's info that there's a optimistic locking problem, then the user can force the commit ignoring the optimistic

Re: Optimistic Locking

2013-09-13 Thread Mike Kienenberger
...@markusreich.at wrote: perfect, thx! 2013/9/13 Mike Kienenberger mkien...@gmail.com On Fri, Sep 13, 2013 at 3:56 AM, Markus Reich markus.re...@markusreich.at wrote: is there a possibility to disalbe optimistic locking for certain entites in runtime?` e.g. the user get's info

Re: Can't instantiate class but it exists

2013-07-31 Thread Mike Kienenberger
The shared container folder will be $CATALINA_HOME/lib, which will have a different classloader than WEB-INF/lib. On Wed, Jul 31, 2013 at 1:57 PM, Andrew Willerding awillerd...@itsurcom.com wrote: On 31/07/2013 1:04 PM, Andrus Adamchik wrote: WEB-INF/classes - contains the classes generated

Re: Problem with invalidation of data

2013-06-12 Thread Mike Kienenberger
The way it worked for me was to check for a change in the data before I tried to do anything else during a request. Then I loaded or modified previously loaded data, then committed. Are you sure you need to check for external changes in the middle of making internal changes? On Wed, Jun 12,

Re: Change data by an external process (non cayenne)

2013-05-16 Thread Mike Kienenberger
Something to keep in mind for web apps is that you probably do not want to have a data refresh at some arbitrary point during a request, only at the beginning of a request. It's generally better to have your data be a second or two out of date than to have the value of an object or object's

Re: Change data by an external process (non cayenne)

2013-05-16 Thread Mike Kienenberger
. On Thu, May 16, 2013 at 2:20 PM, Andrus Adamchik and...@objectstyle.org wrote: On May 16, 2013, at 8:49 PM, Mike Kienenberger mkien...@gmail.com wrote: Something to keep in mind for web apps is that you probably do not want to have a data refresh at some arbitrary point during a request, only

Re: Revert object changes without rollback

2013-04-25 Thread Mike Kienenberger
Rollback works against a context. It rolls back all of the changes in that context since the last commit of that context. Depending on how you use it, most of the time you probably won't even bother to roll back changes -- you just allow the context to be garbage-collected and create a new one.

Re: Unit Testing cayenne apps

2013-04-23 Thread Mike Kienenberger
In older versions of Cayenne, I used this code in my testing framework to change where to load the configuration files: protected Configuration newConfiguration(String cayenneDomainFileName) { DefaultConfiguration conf; if (null == cayenneDomainFileName) {

Re: Relationship

2013-04-23 Thread Mike Kienenberger
I don't quite understand the question you are asking. Can you give us an example of what you are trying to do with your comment table? Some code using your desired mapping would be best. On Tue, Apr 23, 2013 at 12:49 AM, Markus Reich markus.re...@markusreich.at wrote: Hi, with the

Re: Relationship

2013-04-23 Thread Mike Kienenberger
SELECT * FROM order JOIN comments ON comments.OBJECT = 'ORDER' AND comments.ID = order.ID and SELECT * FROM billings JOIN comments ON comments.OBJECT = 'BILLING' AND comments.ID = billing.ID Meex 2013/4/23 Mike Kienenberger mkien...@gmail.com I don't quite understand the question you

  1   2   3   4   >