s sorted, paged queries.
This worked well for a database with 100k's of records
and where I re-ran the query every time the user typed
a new char into a text field to narrow down the search
(including a back-off algorithm supported by the framework).
--
Øyvind Harboe
Can Zylin Consulting help
You need to load cayenne.xml into the modeler in 3.1 and save
it out again.
It will be converted and saved with a new name, cayenne-foo.xml,
which is what you pass to new ServerRuntime().
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International
ase has a primary
key or not, skip!
continue;
}
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International +47 51 87 40 27
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
Properties(),
r.getEventManager());
DataContext context = new DataContext(r, new
ObjectStore(snapshotCache));
context.setValidatingObjectsOnCommit(r.isValidatingObjectsOnCommit());
return context;
}
--
Øyvind H
and hard things possible'
Except for the deprecated methods, I think I've finished
porting to Cayenne 3.1 though! Some nice new features
allowed me to delete code. Always nice!
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International +4
enneRuntime based on a datacontext
class?
Otherwise, I need to reorganize my program so as to push
the cayenneRuntime to the far reaches of the code that needs
it.
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International +47 51 87 40 27
http://w
On Thu, Feb 10, 2011 at 2:27 PM, Michael Gentry wrote:
> Which version of Cayenne are you using? It isn't
> deprecated in Cayenne 3.0.
I'm trying to upgrade to Cayenne 3.1, so I want to stop
using it.
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll fre
In my app I'm creating a new datacontext based on a
existing datacontext, but the method I used to do this
is now deprecated and I don't know what to replace
it with:
getDataContext().getParentDataDomain().createDataContext();
?
--
Øyvind Harboe
Can Zylin Consulting help on your pr
igured via dependency injection.
*/
public static DbAdapterFactory getDefaultFactory() {
return new DbAdapterFactoryChain(defaultFactories);
}
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International +47 51 87 40 27
http://www
After having correctly converted cayenne.xml => Cayenne 3.1
it seems like I can stay blissfully ignorant of inject for a while
still! :-)
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International +47 51 87 40 27
http://www.zylin.com/zy1000.h
y-step 3.0.1 => 3.1 conversion page could have been
helpful here.
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International +47 51 87 40 27
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
It seems like injection is a prerequisite skill to be able to use Cayenne 3.1.
So far I've been able to live in blissful ignorance about injection.
It would be helpful to have an "Injenction for Cayenne 3.1 dummies"
section in the manual as a precursor...
--
Øyvind Harboe
Can Z
rce from
file:/home/oyvind/workspace/qpbtapestry/context/WEB-INF/classes/cayenne.xml
org.apache.cayenne.configuration.XMLDataChannelDescriptorLoader - tag
is unexpected at [32,2]. The following tags are allowed
here: [domain]
I get a bit further, if I manuall strip '', but
that s
problems, which I'll address
in a separate post.
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International +47 51 87 40 27
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
f the list providing some help.
However, one problem that I've run into with web + cayenne applications
is that your object may have been serialized and deserialized, but that's
just a shot in the dark.
--
Øyvind Harboe
Embedded software and hardware consulting services
http://www.zylin.com
features to Cayenne to cover some
off the beaten path usage... You'll probably find that there is a
greater interest in the community to work on the latest stuff than
working on older versions.
--
Øyvind Harboe
Embedded software and hardware consulting services
http://www.zylin.com
On Wed, Jun 10, 2009 at 5:26 PM, Andrus Adamchik wrote:
>
> On Jun 5, 2009, at 11:43 AM, Øyvind Harboe wrote:
>
>> 1. I can't use expression.match() because it will fail when the
>> expression contains
>> an array in the path. I.e. matchExp(role.members.user, user)
e is optional, so an outer join is used.
I need the reverse query that returns all the users responsible for an
incident...
--
Øyvind Harboe
Embedded software and hardware consulting services
http://consulting.zylin.com
for .match(), whereas it works
fine in a query.
2. In the above statement I don't know how to add a andExp() to only return
"this", so I get a bigger query result than I need + unecessary post processing.
I've run into this problem previously as well, without finding an
elegant s
On Thu, Sep 25, 2008 at 10:28 PM, Øyvind Harboe <[EMAIL PROTECTED]> wrote:
> It turned out in my case that the default schema for that user made it,
> correctly, be zero tables available.
I take this back.
The correct schema was used, but the user did not have the access
rights to e
It turned out in my case that the default schema for that user made it,
correctly, be zero tables available.
I.e. there was no error condition and Cayenne did the right thing,
produce the create table merger tokens.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
application, especially
since it is intended to
run unsupervised(or by a user not capable of supervising).
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
r = (SQLServerAdapter) adapter;
sqladapter.createTableAppendColumn(sqlBuffer, column);
return Collections.singletonList(sqlBuffer.toString());
}
};
}
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
ption upon failure...
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
code follows the restrictions in Derby.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
.setMaxFetchSize(1000);
> // 1000 is just a random #, you'll need to play with this parameter to
> optimize it
> // default is 1.
For non-paginated queries there is no solution today?
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
ndExpression(Unknown
Source)
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
?
For instance there may be *another* piece of code that does not use Cayenne
that would be harmed by such a change and therefore table X should not
be modified thus...
I'm leaning towards leaving this in the application domain
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7
ributes in getColumnOriginal()
and getColumnNew()?
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
ith Cayenne with a tiny amount
of code, but it is kinda hard to tell whether or not one is
doing it the intentional way or not.
My local copy of the MergerContext interface does not contain any documentation
of the methods.
I guess if it works, it's OK. :-)
--
Øyvind Harboe
http://www.zyl
AbstractToDbToken and invoke createSql() directly?
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
Is the DbGenerator an anachronism as far as applications are concerned
at this point?
E.g. I discovered that the AUTO_PK_SUPPORT is correctly added w/MergeContext
whereas DbGenerator resets the counters to 200.
Perhaps the JavaDoc for DbGenerator should encourage use of MergeContext?
--
Øyvind
information such as default value handling
encoded.
I assume that my CayenneDataObject subclass could get at the
comment text from within a getProperty() override.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
Also a comment/description field for each column/table in
CayenneModeler might be nice
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
ial bit is to be able to tabulate handling of default values. Perhaps
use a custom base class for all the CayenneDataObject subclasses and
override readProperty() to handle null pointers via a lookup...
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
x27;m not quite sure if I have decided what to expect from Expression's.
If I search for a value in the database that is equal to the default value,
would I then expect rows w/NULL to match? Probably not.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
On Tue, Aug 12, 2008 at 12:26 AM, Andrus Adamchik
<[EMAIL PROTECTED]> wrote:
>
> On Aug 9, 2008, at 12:18 PM, Øyvind Harboe wrote:
>
>> I guess the problem I see is that I test only against one or two databases
>> so I'd rather see the *same* behaviour across data
against one or two databases
so I'd rather see the *same* behaviour across databases regardless of what
JDBC is defined to do... We flipped scale="2" for all our NUMERIC types
since that is what our application assumes.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XSc
od for a given object class. So what is the class
> of the object parameter? BigDecimal? Something else?
BigDecimal.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
) and afterwards the queries return e.g. "1"
instead of "1.5".
If I run a select statement from *outside* Cayenne, it reveals that the data in
the database are actually truncated.
Is there a testcase for this in Cayenne?
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 AR
On Fri, Aug 8, 2008 at 10:20 AM, Øyvind Harboe <[EMAIL PROTECTED]> wrote:
> If I set scale to blank (default) or -1, then Derby will round off down
> to nearest whole number whereas SQL Server will not.
Relevant?
http://mail-archives.apache.org/mod_mbox/db-derby-commits/200505
If I set scale to blank (default) or -1, then Derby will round off down
to nearest whole number whereas SQL Server will not.
Is this intentional?
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
On Tue, Jul 8, 2008 at 1:28 PM, Tore Halset <[EMAIL PROTECTED]> wrote:
> On 8. juli. 2008, at 13.20, Øyvind Harboe wrote:
>
>> Does Cayenne have the ability to add/remove unique constraints for
>> columns?
>
> "No" or perhaps "Not yet" :) The
Does Cayenne have the ability to add/remove unique constraints for
columns?
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
on, nothing but loading all
the objects into memory would do the trick, so it's not really
a question of caching strategies.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
less than n ms. I never measured how long it actually
takes to log a query This sort of caching is what I would have
expected databases to have done to death...
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
ant, they could be dumped if
more than N seconds has passed since they were last used.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
now nicely garbage collected while at the same time
using a sensible amount of memory to speeed up the Java code
that does the selection of which records to process
Being able to select which columns to load on demand will be
important elsewhere though.
--
Øyvind Harboe
http://www.zylin
tried to map a second DbEntity to the same table, but as the
name of the table is used as a key to the DbEntity that didn't work. This
would have to be in a seperate DataMap then?
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
u have a few of options:
>
> 1. Place large columns in a separate table with 1..1 relationship to the
> master table .
Hmm... will this actually work?
Is there a weak reference between the two?
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
is common between FastFoo and Foo.
It didn't occur to me that it was supported to have multiple mappings
to the same database
table.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
emplates obviously.
SelectTranslator.createSqlString() unconditionally adds all
columns...
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
the rest of my life.
Cayenne can of course make it easier to implement such
lists by many means, e.g.:
- add a Wiki page
- add a copy & paste & modify class
- add a class that is intended for subclassing to handle
application specific access patterns
--
Øyvind Harboe
http://www.zylin.com/z
memory, but is rather optimized for a single
iteration in a linear fashion. Taking handling of large tables a step
further, support could be added for iterating over queries where even
the pk's won't fit into memory(heap could be limited or tables could be
large).
--
Øyvind Harboe
http:
On Sun, Jun 22, 2008 at 10:28 PM, Andrus Adamchik
<[EMAIL PROTECTED]> wrote:
>
> On Jun 20, 2008, at 10:41 PM, Øyvind Harboe wrote:
>
>> - the JavaDoc explained *why* the synchronization is there and what it
>> is supposed to do and how the client is supposed to use it.
cation.
>From the clients point of view there is only a single thread.
What other threads are there?
Also, the type of locking used must be documented. According to the
collections framework, it won't "just work" without explicitly synchronizing.
--
Øyvind Harboe
http://www.z
le, if either:
- the JavaDoc explained *why* the synchronization is there and what it
is supposed to do and how the client is supposed to use it.
- it serves some internal purpose and that purpose was stated as a comment
in the code
- the synchronization code was deleted(faster + less chanc
I'm toying around with weak references in paged queries.
This turned out to be rather hairy from the point of view that
a query is supposed to return a List and this List has
to live up to a lot of expectations from the calling code +
promises of the List interfaces.
Consider two of the subList
n use only the Iterable interface,
even if performQuery() returns a List and then only from
a single thread.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
in my list above.
> #1 & #2 are accurate.
Great!
Thanks!
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
lse, then I need to
go into the application and fix it.
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
On Fri, Jun 20, 2008 at 10:22 AM, Andrus Adamchik
<[EMAIL PROTECTED]> wrote:
>
>
>
> On Jun 20, 2008, at 10:45 AM, Øyvind Harboe wrote:
>
>> 1. Consider the code below. Will all the objects from the query
>> be locked in memory?
>>
>> query=new Sele
. I'd love it if adding a setPageSize() was all that was needed to
solve these peak memory usage problems.
I think I'll tinker a bit with a patch...
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
t=l.remove(0);
/* do processing here */
}
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
mall amount of CayenneDataObject's are
locked in memory at the time?
Some ideas:
- use performIteratedQuery() w/setPageSize()
- ResultIterator.nextDataRow() is a bit strange: it returns a Map<>, but
perhaps I can safely upcast that.
- use objectFromdataRow()
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
27;s not like we would need to re-enhance Java
bytecode or anything :-)
IYO, is it easy/difficult? Good/bad idea for what I'm trying to achieve?
Way to go? Should I look at other alternatives?
Andrus
On Jul 20, 2007, at 9:42 PM, Øyvind Harboe wrote:
> Currently our Cayenne app h
that don't do robust reengineering
(FoxBase, MS Access, shudder!), but presumably we could
programatically adapt the Cayenne database schema for those/stick with
a default one which we do today.
--
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA developer kit
bases to the same underlying database yields, hopefully,
no visible change to the application and it is harder to get that sort of work
funded in a project.
--
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA developer kit
t/set relationship methods in the CayenneDataObject
subclasses in a way that works for uncommitted changes.
--
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA developer kit
a query to
implement the "getToXxx()" across databases, but that breaks when I
want the "getToXxx()" to work for an uncommitted changed relationship
across databases.
--
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA developer kit
Cayenne can only said to be inefficient if the application could,
somehow, do this more efficiently, right?
--
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA developer kit
done on supporting this?
We've got a real database (Derby) that has relationships to other
existing datbases(MS Access/FoxPro databases). We can't move the
existing databases into Derby due to bug-by-bug compatibility
problems.
http://cwiki.apache.org/CAY/multiple-databases-example
havior?
Being ignorant about what's actually going on, I point my finger at
DataPort. We're not experiencing any other problems with the database
configured in this fashion
--
Øyvind Harboe
http://www.zylin.com
with Tomcat
connection pooling???
I wrote connection configuration according to the examples in the Tomcat doc.
From (fails):
To (which works):
--
Øyvind Harboe
http://www.zylin.com
atch (CayenneException ex) {
}
}
} catch (CayenneException e)
{
/* Continue anyway */
e.printStackTrace();
}
}
}
--
Øyvind Harboe
http://www.zylin.com
76 matches
Mail list logo