Aristedes Maniatis | 16 May 2013 01:49
Picon
Favicon
Gravatar

ROP security

We have a ROP Cayenne application we'd like to lock down a bit more tightly. In particular, in a situation
where we don't trust the client application hasn't been hacked, we'd like to restrict certain activity
from the client. I'm thinking of:

1. preventing SQLTemplate/EJBQL queries completely
2. adding entity listeners to catch certain write behaviour (we can't do a lot about reading data since
that's easy to do at the controller level, on the client, but pretty hard to construct rules at the model
level on the server)
3. creating 'partial' object entities which are missing some attributes. Sort of hollow, but only hollow
on some attributes.

Has anyone attempted anything similar to the above? (2) should be easy enough, but not sure about the other requirements.

Cheers
Ari

--

-- 
-------------------------->
Aristedes Maniatis
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Markus Reich | 15 May 2013 15:28
Picon

Change data by an external process (non cayenne)

Hi,

is there really no better way than described here:
http://markmail.org/message/plnaj4zj4gxrt6hk

regards
Meex
Markus Reich | 15 May 2013 14:48
Picon

Prefetch paths

Hi,

is it possible to use wildcards in prefetch paths?

e.g. query.addPrefetch("paintings.gallery");

regards
Meex
Markus Reich | 8 May 2013 13:37
Picon

Disabling caching for relationship queries

Hi,

is there a possibility to disable the default cayenne caching mechanism
used to get relational data?
I already set Shared Cache to false and Number of Objects to 0, but it
still doesn't work :-(

regards
Meex
Andrus Adamchik | 6 May 2013 21:07
Favicon

Cayenne training day, Montreal, June 23rd

Hi everyone,

A reminder about the Cayenne Training Day at WOWODC in Montreal on June 23rd:

  http://www.wocommunity.org/wowodc13/cayenne.html

You can buy tickets for just the Cayenne day (not the entire WOWODC). There will be references to WebObjects
in my presentations as we'll be discussing Cayenne as an alternative to proprietary Apple technologies.
But otherwise (and except for the first segment) it will be pure Cayenne. 

BTW, thanks to all those who answered the earlier survey! :)

Andrus

Dynamic datasource switch

Hi.

I have 3 databases which shares exactly the same schema.
I sometimes need to switch from one to another programatically.

For that purpose, i wrote the folowing code :

    public void setCompany(int salesAgencyId) {
        this.salesAgencyId = salesAgencyId;
        switch (salesAgencyId) {
            case COMPANY_C1:
                setC1DataContext();
                break;
            case COMPANY_C2:
                setC2DataContext();
                break;
            case COMPANY_C3:
                setC3DataContext();
                break;

            default:
                setC1DataContext();
                break;
        }
    }

    private static void setC1DataContext() {
        if (COMPANY_CURRENT != COMPANY_C1) {
            LOG.debug("switching context from " + COMPANY_CURRENT + " to
" + COMPANY_C1);
(Continue reading)

Markus Reich | 24 Apr 2013 20:37
Picon

Revert object changes without rollback

Hi,

is it possible to revert changes of an object? I don't want to use rollback
because changes of other objects shouldn't be reverted?
I know about child contexts, but my problem is, i select a collection of
object, and change them in a differnt UI view and in this view I want to
revert the changes?
Is it possible to create a child context and move an object from one
context to another (child) context?

Meex
Lon Varscsak | 24 Apr 2013 20:14
Picon

Peer Context Synchronization

Hey all, I'm having some trouble with something that I _think_ should work.
:)

It's a very common pattern for me to create a new context, do work, save,
and expect those changes to make it back into peer contexts that share
object ids.

However, there are times where this isn't happening…and it's intermittent.

My model in this situation is pretty simple, there's EntityA with a to-many
to EntityB.  In a peer context, I'm creating an EntityB and adding it to
the relationship of EntityA (a local instance), and generally speaking, in
my other peer context the matching instance of EntityA is updated and has
the proper EntityB in it's relationship (after commitChanges).

However, occasionally…maybe 1 in 10, the peer context doesn't get
immediately updated (although will, I believe, at a later time).

So the question is, does commitChanges immediately/synchronously push all
changes into peer contexts?  Or does it happen in another way?

Thanks for any insight.

-Lon
Juan José Gil | 23 Apr 2013 14:05
Picon

Unit Testing cayenne apps

Hi, I'm using cayenne as persistence layer.

The project is builded with maven and developed with Eclipse.

The DB is migrated using flyway (http://flywaydb.org/) and I'm using
different DBs config for:

 * production
 * development
 * testing

So, for migrations, deployment, continuous integration and anything that
relies on maven I'm using maven "filtering" capabilities to define the jdbc
url of the database to be used.

BUT when I'm working at eclipse, and try to run my tests / startup my
webapp, I cant filter the project resources (not automatically at least)
So currently I'm copy-pasting my cayenne conf from src/main/resources/db to
src/test/resources/db... and I'm not happy with this solution, I feel it
smelly, propense to failure, it's ugly, very ugly!

I did try to only define the cayenne config at testing resources, but when
I do that, it doesn't find the mapping xml.

Is there a way con pass the mapping path instead of a mapping name to a
cayenne config?

Can someone point me what should be done to avoid this code/conf smell?
Markus Reich | 23 Apr 2013 06:49
Picon

Relationship

Hi,

with the wonderful Cayenne Modeler it's possible to easily create relations
between DB entities.
In my case I have a central table for comments, with a key specifying the
content.
No I need to map this key field to a constant literal, as I know it is just
possible to join fields with fields of the target entity :-(
Is there a workaround (I don't like to make a lot of views an join them ;-))

regards
Meex
Markus Reich | 22 Apr 2013 10:51
Picon

Convert Oracle Type NUMBER to java.lang.Boolean

Hi,

I've a problem with using boolean values in my cayenne class.
In Oracle DB the field has type NUMBER and contains only 0 or 1 as value.
Now I thought I can map this to a Boolean?
I came to this because it also works when I select with an Expression:
ExpressionFactory.matchExp(MiiPickingcontainer.DELETED_PROPERTY, false));

But when I make a check with getDeleted()==false, it doesn't work as
getDeleted() always returns false?

What would be the best approach to transform a Oracle NUMBER to a Boolean?

Markus

Gmane