You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Peter Schröder <Pe...@freenet-ag.de> on 2007/02/13 12:10:09 UTC

cayenne with jetty6

hi there,

i was trying to run the cayenne-filter with jetty6-maven-plugin, but it did not work out for me...
even with including all dependencies to the jetty-plugin i failed to use the jndi-backup-mechanism, wich i use successfully witch the jetty-launcher.

perhaps someone could add the docs http://cayenne.apache.org/doc/tutorial-webapp.html with some usefull information about jetty6.

kind regards,
peter

-----Ursprüngliche Nachricht-----
Von: Aristedes Maniatis [mailto:ari@ish.com.au] 
Gesendet: Montag, 12. Februar 2007 04:51
An: user@cayenne.apache.org
Betreff: Re: Version 2 doc linking


On 12/02/2007, at 1:58 PM, Andrus Adamchik wrote:

> Documentation "branches" are a necessary evil, just like code  
> branches (e.g. similarly we often have to apply identical bug fixes  
> to 1.2, 2.0, and 3.0 at the same time), and in fact they correspond  
> to the *maintained* code branches.

Except that unlike code, we have no diff or merge concepts available  
to us. Documentation is completely unlike code also in the sense that  
it is helpful to update old documentation for greater clarity even  
when the old code is not being touched. Don't you hate it when you  
have to use the new documentation because that is the only place to  
get the answers, code samples, etc but then you don't know which  
parts are relevant and which aren't?

And we have to be realistic: will the old docs ever get updated?  
Probably not.

> Going forward we can reduce the number of versions maintained at  
> any given moment to just two (1.2 vs. 2.0 vs. 3.0 is a unique  
> situation caused by us joining Apache). I.e. when 3.0 becomes  
> "STABLE" and 4.0 becomes development release, we will pull 1.2 and  
> 2.0 doc sets from the site entirely.

There isn't a need to make old docs vanish completely. Perhaps they  
just drop off the menus and are a little more hidden in the site  
navigation, but it doesn't affect anything other than taking up a  
little more space in the Confluence database.

I guess we will need to see what 4.0 is going to bring before we will  
know whether it needs a new branch. If the focus is on a new area,  
then perhaps it just needs a chapter heading called "New whizz bang  
feature (4.0 only)"... I use another product where every page in the  
docs is simply titled with "introduced in version x".

>> Perhaps a tag we attach to the page or part of a page which  
>> indicates the version in which that feature was introduced.
>
> This is a good idea to do for the current releases. At the same  
> time including the docs for the not-yet-existing features with an  
> old release can be confusing. Even worse, some framework concepts  
> change over time, with old concepts/API being removed from the  
> docs, so stable release users can get the wrong picture.

Yes, you are right. But some of those concepts will probably be more  
set in stone in the future as Cayenne matures. Anyhow, nothing needs  
to be done until 4.0 or 3.1 is starting to be planned.


Ari 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



Re: getting bad connection

Posted by Frank <fa...@hotmail.com>.
I am closing the connection.
It seems to fail after I return from a page that executes this.

private List filterRecords(String empno) {
     DataContext context = DataContext.getThreadDataContext();
     Expression qualifier = 
ExpressionFactory.matchExp(Employees.EMEMP_NO_PROPERTY, empno);
     SelectQuery query = new SelectQuery(Employees.class);
     query.andQualifier(qualifier);
     List employees = context.performQuery(query);
     return employees;
    }

Thanks
Frank
----- Original Message ----- 
From: "Andrus Adamchik" <an...@objectstyle.org>
To: <us...@cayenne.apache.org>
Sent: Tuesday, February 13, 2007 11:21 AM
Subject: Re: getting bad connection


> Frank,
>
>> after a number of calls, it fails.
>
> it would help if you provide the details of your problems, like  Exception 
> stack traces.
>
> My guess will be that you are not closing the connections\. You must  call 
> Connection.close() every time after you finish working with a  connection.
>
> Andrus
>
>
> On Feb 13, 2007, at 11:14 AM, Frank wrote:
>> Hello,
>>
>> I have this in a class to return a Cayenne connection.
>> It works ok at first, but after a number of calls, it fails.
>>
>> public class DBConnections {....
>> public Connection getAS400Connection() {
>> try {
>>     Configuration config = Configuration.getSharedConfiguration();
>>     DataDomain domain = config.getDomain();
>>     DataNode node = domain.getNode("cdsurveyDomainNode1");
>>     return node.getDataSource().getConnection();
>>  } catch (Exception ex) {
>>   return null;
>>  }
>> }
>>
>> Thanks
>>
>> Frank
>>
>
> 


Re: OutOfMemoryErrors (solved)

Posted by Michael Gentry <bl...@gmail.com>.
That's still a lot of records to return from a query, but sometimes
you need that, too.  Increasing the memory is probably appropriate,
then.

/dev/mrg


On 2/15/07, Frank <fa...@hotmail.com> wrote:
> My query returned less than 2700 records.
> My schema was large, about 190 fields.
>
> I trimmed this down to about 5 and increased the JVM.
>
> Regards,
>
> Frank
> ----- Original Message -----
> From: "Michael Gentry" <bl...@gmail.com>
> To: <us...@cayenne.apache.org>
> Sent: Thursday, February 15, 2007 9:27 AM
> Subject: Re: OutOfMemoryErrors (solved)
>
>
> > Bumping the heap size up is probably fine, but I also suspect Frank
> > might be trying to read in too much data given his previous postings
> > using LIKE expressions.  He may be getting back tens of thousands of
> > rows, if not more.  Perhaps his application requires that, though.
> >
> > /dev/mrg
> >
> >
> > On 2/15/07, Andrus Adamchik <an...@objectstyle.org> wrote:
> >> You are being too picky. Why is this not a solution? Default 64m heap
> >> size for the JVM is not enough for most applications nowadays ;-)
> >>
> >> Andrus
> >>
> >>
> >> On Feb 15, 2007, at 2:47 AM, Juergen Saar wrote:
> >>
> >> > This is a workaround, but not a solution ...
> >> >
> >> > -sorry-
> >> > --- Juregen ---
> >> >
> >> > 2007/2/14, Frank <fa...@hotmail.com>:
> >> >>
> >> >> Hi Andrus,
> >> >>
> >> >> I bumped the JVM up to 512m
> >> >> This resolved my issue.
> >> >> I also removed AS400 fields not needed in my query to help reduce
> >> >> memory
> >> >> requirements.
> >> >>
> >> >> Regards,
> >> >>
> >> >> Frank
> >> >>
> >> >>
> >>
> >>
> >
>

Re: How to query a relationship

Posted by Frank <fa...@hotmail.com>.
Here is my original query string:

String sql = "SELECT BSYDTAA.BSYPEMP.EMYLNM, BSYDTAA.BSYPEMP.EMYFNM, 
BSYDTAC.BPRPPCP.PCDEP4, BSYDTAC.BPRPPCP.PCLDDS, BSYDTAA.BSYPEMP.EMEMP# AS 
EMEMP, BSYDTAA.BSYPEMP.EMWPH# AS WPHONE FROM BSYDTAA.BSYPEMP, 
BSYDTAC.BPRPPCP WHERE BSYDTAA.BSYPEMP.EMHSP# = BSYDTAC.BPRPPCP.PCHSP# AND 
BSYDTAA.BSYPEMP.EMDEP4 = BSYDTAC.BPRPPCP.PCDEP4 AND (BSYDTAA.BSYPEMP.EMHSP# 
IN (1,5)) AND (BSYDTAA.BSYPEMP.EMDOT=0)";

sql += " AND EMYLNM like ?";

sql += " AND EMYFNM like ?";

sql += " ORDER BY EMYLNM";



Thanks

Frank

----- Original Message ----- 
From: "Michael Gentry" <bl...@gmail.com>
To: <us...@cayenne.apache.org>
Sent: Thursday, February 15, 2007 10:06 AM
Subject: Re: How to query a relationship


> When you were using JDBC, did you have something like a right outer
> join?  (An optional relationship?)
>
> /dev/mrg
>
>
> On 2/15/07, Frank <fa...@hotmail.com> wrote:
>> Hi Michael,
>>
>> I looked at your tutorial in motion, (it has hellped me understand 
>> cayenne
>> better)
>> and have tried setting one to many on the department table.
>>
>> It still fails trying to query department # = 0 and hsp#=5
>> because there is no match in th erelated table.
>>
>> Should I just filter out records where department # is 0?
>> I did not have this problem when I did a jdbc join prior to using 
>> cayenne.
>>
>> I am kinda lost at how to resolve this.
>>
>> Regards,
>>
>> Frank
>>
>>
> 


Re: How to query a relationship

Posted by Michael Gentry <bl...@gmail.com>.
When you were using JDBC, did you have something like a right outer
join?  (An optional relationship?)

/dev/mrg


On 2/15/07, Frank <fa...@hotmail.com> wrote:
> Hi Michael,
>
> I looked at your tutorial in motion, (it has hellped me understand cayenne
> better)
> and have tried setting one to many on the department table.
>
> It still fails trying to query department # = 0 and hsp#=5
> because there is no match in th erelated table.
>
> Should I just filter out records where department # is 0?
> I did not have this problem when I did a jdbc join prior to using cayenne.
>
> I am kinda lost at how to resolve this.
>
> Regards,
>
> Frank
>
>

Re: OutOfMemoryErrors (solved)

Posted by Frank <fa...@hotmail.com>.
My query returned less than 2700 records.
My schema was large, about 190 fields.

I trimmed this down to about 5 and increased the JVM.

Regards,

Frank
----- Original Message ----- 
From: "Michael Gentry" <bl...@gmail.com>
To: <us...@cayenne.apache.org>
Sent: Thursday, February 15, 2007 9:27 AM
Subject: Re: OutOfMemoryErrors (solved)


> Bumping the heap size up is probably fine, but I also suspect Frank
> might be trying to read in too much data given his previous postings
> using LIKE expressions.  He may be getting back tens of thousands of
> rows, if not more.  Perhaps his application requires that, though.
> 
> /dev/mrg
> 
> 
> On 2/15/07, Andrus Adamchik <an...@objectstyle.org> wrote:
>> You are being too picky. Why is this not a solution? Default 64m heap
>> size for the JVM is not enough for most applications nowadays ;-)
>>
>> Andrus
>>
>>
>> On Feb 15, 2007, at 2:47 AM, Juergen Saar wrote:
>>
>> > This is a workaround, but not a solution ...
>> >
>> > -sorry-
>> > --- Juregen ---
>> >
>> > 2007/2/14, Frank <fa...@hotmail.com>:
>> >>
>> >> Hi Andrus,
>> >>
>> >> I bumped the JVM up to 512m
>> >> This resolved my issue.
>> >> I also removed AS400 fields not needed in my query to help reduce
>> >> memory
>> >> requirements.
>> >>
>> >> Regards,
>> >>
>> >> Frank
>> >>
>> >>
>>
>>
>

Re: OutOfMemoryErrors (solved)

Posted by Michael Gentry <bl...@gmail.com>.
Bumping the heap size up is probably fine, but I also suspect Frank
might be trying to read in too much data given his previous postings
using LIKE expressions.  He may be getting back tens of thousands of
rows, if not more.  Perhaps his application requires that, though.

/dev/mrg


On 2/15/07, Andrus Adamchik <an...@objectstyle.org> wrote:
> You are being too picky. Why is this not a solution? Default 64m heap
> size for the JVM is not enough for most applications nowadays ;-)
>
> Andrus
>
>
> On Feb 15, 2007, at 2:47 AM, Juergen Saar wrote:
>
> > This is a workaround, but not a solution ...
> >
> > -sorry-
> > --- Juregen ---
> >
> > 2007/2/14, Frank <fa...@hotmail.com>:
> >>
> >> Hi Andrus,
> >>
> >> I bumped the JVM up to 512m
> >> This resolved my issue.
> >> I also removed AS400 fields not needed in my query to help reduce
> >> memory
> >> requirements.
> >>
> >> Regards,
> >>
> >> Frank
> >>
> >>
>
>

Re: OutOfMemoryErrors (solved)

Posted by Andrus Adamchik <an...@objectstyle.org>.
You are being too picky. Why is this not a solution? Default 64m heap  
size for the JVM is not enough for most applications nowadays ;-)

Andrus


On Feb 15, 2007, at 2:47 AM, Juergen Saar wrote:

> This is a workaround, but not a solution ...
>
> -sorry-
> --- Juregen ---
>
> 2007/2/14, Frank <fa...@hotmail.com>:
>>
>> Hi Andrus,
>>
>> I bumped the JVM up to 512m
>> This resolved my issue.
>> I also removed AS400 fields not needed in my query to help reduce  
>> memory
>> requirements.
>>
>> Regards,
>>
>> Frank
>>
>>


Re: OutOfMemoryErrors (solved)

Posted by Juergen Saar <ju...@jsaar.org>.
This is a workaround, but not a solution ...

-sorry-
--- Juregen ---

2007/2/14, Frank <fa...@hotmail.com>:
>
> Hi Andrus,
>
> I bumped the JVM up to 512m
> This resolved my issue.
> I also removed AS400 fields not needed in my query to help reduce memory
> requirements.
>
> Regards,
>
> Frank
>
>

Re: How to query a relationship

Posted by Frank <fa...@hotmail.com>.
Hi Michael,

I looked at your tutorial in motion, (it has hellped me understand cayenne 
better)
and have tried setting one to many on the department table.

It still fails trying to query department # = 0 and hsp#=5
because there is no match in th erelated table.

Should I just filter out records where department # is 0?
I did not have this problem when I did a jdbc join prior to using cayenne.

I am kinda lost at how to resolve this.

Regards,

Frank 


Re: How to query a relationship

Posted by Frank <fa...@hotmail.com>.
I traced this to the first table bsypemp has many records where the 
department #  (emdep4) is 0
So I think cayenne is trying to join these records to bprppcp and fails.

By join is:
bsypemp->emhsp# to brpppcp->pchsp#
bsypemp->emdep4 to brpppcp->pcdep4

dep4 is the department #

Thanks
Frank
----- Original Message ----- 
From: "Michael Gentry" <bl...@gmail.com>
To: <us...@cayenne.apache.org>
Sent: Thursday, February 15, 2007 9:08 AM
Subject: Re: How to query a relationship


> Well, the error message:
>
> No matching getter method found for property Pcldds on class
> stemc.cayenne.as400.Bsypemp
>
> is indeed correct, because that property is in your Bprppcp class.  I
> didn't see anything else initially in your code that helped me
> understand why you got that, but it is obvious that Cayenne is trying
> to look at Bsypemp instead of Bprppcp for that value (and it is in
> Bprppcp according to your code).  You could try checking the model,
> etc.  If you need more help for relationships, there are several
> documentation pages that talk about constructing them and I do a fair
> number of them in the Cayenne In Motion example.
>
> /dev/mrg
>
>
> On 2/14/07, Frank <fa...@hotmail.com> wrote:
>> Hello,
>>
>> I have as AS400 relationship defined between two tables.
>> I need to include a column from the second table in my list.
>>
>> Here is my error:
>> No matching getter method found for property Pcldds on class
>> stemc.cayenne.as400.Bsypemp
>>
>> Thanks
>> Frank
>>
>> Here is my query:
>> Expression e = ExpressionFactory.matchDbExp
>>
>> (Bsypemp.EMHSPPOUND_PK_COLUMN, new Integer(1));
>>
>> e = e.andExp(ExpressionFactory.likeExp(Bsypemp.EMYLNM_PROPERTY, lname
>>
>> +"%"));
>>
>>
>> SelectQuery query = new SelectQuery(Bsypemp.class,e);
>>
>> List records = context.performQuery(query);
>>
>> Here is my first table:
>> package stemc.cayenne.as400.auto;
>>
>>
>> /** Class _Bsypemp was generated by Cayenne.
>>
>> * It is probably a good idea to avoid changing this class manually,
>>
>> * since it may be overwritten next time code is regenerated.
>>
>> * If you need to make any customizations, please use subclass.
>>
>> */
>>
>> public class _Bsypemp extends org.objectstyle.cayenne.CayenneDataObject {
>>
>>
>> public static final String E_MEMPPOUND_PROPERTY = "eMEMPpound";
>>
>> public static final String E_MHSPPOUND_PROPERTY = "eMHSPpound";
>>
>> public static final String E_MWPHPOUND_PROPERTY = "eMWPHpound";
>>
>> public static final String EMDEP4_PROPERTY = "emdep4";
>>
>> public static final String EMYFNM_PROPERTY = "emyfnm";
>>
>> public static final String EMYLNM_PROPERTY = "emylnm";
>>
>>
>> public static final String EMEMPPOUND_PK_COLUMN = "EMEMP#";
>>
>> public static final String EMHSPPOUND_PK_COLUMN = "EMHSP#";
>>
>>
>> public void setEMEMPpound(java.math.BigDecimal eMEMPpound) {
>>
>> writeProperty("eMEMPpound", eMEMPpound);
>>
>> }
>>
>> public java.math.BigDecimal getEMEMPpound() {
>>
>> return (java.math.BigDecimal)readProperty("eMEMPpound");
>>
>> }
>>
>>
>>
>> public void setEMHSPpound(java.math.BigDecimal eMHSPpound) {
>>
>> writeProperty("eMHSPpound", eMHSPpound);
>>
>> }
>>
>> public java.math.BigDecimal getEMHSPpound() {
>>
>> return (java.math.BigDecimal)readProperty("eMHSPpound");
>>
>> }
>>
>>
>>
>> public void setEMWPHpound(java.math.BigDecimal eMWPHpound) {
>>
>> writeProperty("eMWPHpound", eMWPHpound);
>>
>> }
>>
>> public java.math.BigDecimal getEMWPHpound() {
>>
>> return (java.math.BigDecimal)readProperty("eMWPHpound");
>>
>> }
>>
>>
>>
>> public void setEmdep4(java.math.BigDecimal emdep4) {
>>
>> writeProperty("emdep4", emdep4);
>>
>> }
>>
>> public java.math.BigDecimal getEmdep4() {
>>
>> return (java.math.BigDecimal)readProperty("emdep4");
>>
>> }
>>
>>
>>
>> public void setEmyfnm(String emyfnm) {
>>
>> writeProperty("emyfnm", emyfnm);
>>
>> }
>>
>> public String getEmyfnm() {
>>
>> return (String)readProperty("emyfnm");
>>
>> }
>>
>>
>>
>> public void setEmylnm(String emylnm) {
>>
>> writeProperty("emylnm", emylnm);
>>
>> }
>>
>> public String getEmylnm() {
>>
>> return (String)readProperty("emylnm");
>>
>> }
>>
>>
>>
>> }
>>
>> Here is my second table
>>
>> package stemc.cayenne.as400.auto;
>>
>>
>> /** Class _Bprppcp was generated by Cayenne.
>>
>> * It is probably a good idea to avoid changing this class manually,
>>
>> * since it may be overwritten next time code is regenerated.
>>
>> * If you need to make any customizations, please use subclass.
>>
>> */
>>
>> public class _Bprppcp extends org.objectstyle.cayenne.CayenneDataObject {
>>
>>
>> public static final String P_CHSPPOUND_PROPERTY = "pCHSPpound";
>>
>> public static final String PCDEP4_PROPERTY = "pcdep4";
>>
>> public static final String PCLDDS_PROPERTY = "pcldds";
>>
>>
>> public static final String PCDEP4_PK_COLUMN = "PCDEP4";
>>
>> public static final String PCHSPPOUND_PK_COLUMN = "PCHSP#";
>>
>>
>> public void setPCHSPpound(java.math.BigDecimal pCHSPpound) {
>>
>> writeProperty("pCHSPpound", pCHSPpound);
>>
>> }
>>
>> public java.math.BigDecimal getPCHSPpound() {
>>
>> return (java.math.BigDecimal)readProperty("pCHSPpound");
>>
>> }
>>
>>
>>
>> public void setPcdep4(java.math.BigDecimal pcdep4) {
>>
>> writeProperty("pcdep4", pcdep4);
>>
>> }
>>
>> public java.math.BigDecimal getPcdep4() {
>>
>> return (java.math.BigDecimal)readProperty("pcdep4");
>>
>> }
>>
>>
>>
>> public void setPcldds(String pcldds) {
>>
>> writeProperty("pcldds", pcldds);
>>
>> }
>>
>> public String getPcldds() {
>>
>> return (String)readProperty("pcldds");
>>
>> }
>>
>>
>>
>> }
>>
>>
> 


Re: How to query a relationship

Posted by Michael Gentry <bl...@gmail.com>.
Well, the error message:

No matching getter method found for property Pcldds on class
stemc.cayenne.as400.Bsypemp

is indeed correct, because that property is in your Bprppcp class.  I
didn't see anything else initially in your code that helped me
understand why you got that, but it is obvious that Cayenne is trying
to look at Bsypemp instead of Bprppcp for that value (and it is in
Bprppcp according to your code).  You could try checking the model,
etc.  If you need more help for relationships, there are several
documentation pages that talk about constructing them and I do a fair
number of them in the Cayenne In Motion example.

/dev/mrg


On 2/14/07, Frank <fa...@hotmail.com> wrote:
> Hello,
>
> I have as AS400 relationship defined between two tables.
> I need to include a column from the second table in my list.
>
> Here is my error:
> No matching getter method found for property Pcldds on class
> stemc.cayenne.as400.Bsypemp
>
> Thanks
> Frank
>
> Here is my query:
> Expression e = ExpressionFactory.matchDbExp
>
> (Bsypemp.EMHSPPOUND_PK_COLUMN, new Integer(1));
>
> e = e.andExp(ExpressionFactory.likeExp(Bsypemp.EMYLNM_PROPERTY, lname
>
> +"%"));
>
>
> SelectQuery query = new SelectQuery(Bsypemp.class,e);
>
> List records = context.performQuery(query);
>
> Here is my first table:
> package stemc.cayenne.as400.auto;
>
>
> /** Class _Bsypemp was generated by Cayenne.
>
> * It is probably a good idea to avoid changing this class manually,
>
> * since it may be overwritten next time code is regenerated.
>
> * If you need to make any customizations, please use subclass.
>
> */
>
> public class _Bsypemp extends org.objectstyle.cayenne.CayenneDataObject {
>
>
> public static final String E_MEMPPOUND_PROPERTY = "eMEMPpound";
>
> public static final String E_MHSPPOUND_PROPERTY = "eMHSPpound";
>
> public static final String E_MWPHPOUND_PROPERTY = "eMWPHpound";
>
> public static final String EMDEP4_PROPERTY = "emdep4";
>
> public static final String EMYFNM_PROPERTY = "emyfnm";
>
> public static final String EMYLNM_PROPERTY = "emylnm";
>
>
> public static final String EMEMPPOUND_PK_COLUMN = "EMEMP#";
>
> public static final String EMHSPPOUND_PK_COLUMN = "EMHSP#";
>
>
> public void setEMEMPpound(java.math.BigDecimal eMEMPpound) {
>
> writeProperty("eMEMPpound", eMEMPpound);
>
> }
>
> public java.math.BigDecimal getEMEMPpound() {
>
> return (java.math.BigDecimal)readProperty("eMEMPpound");
>
> }
>
>
>
> public void setEMHSPpound(java.math.BigDecimal eMHSPpound) {
>
> writeProperty("eMHSPpound", eMHSPpound);
>
> }
>
> public java.math.BigDecimal getEMHSPpound() {
>
> return (java.math.BigDecimal)readProperty("eMHSPpound");
>
> }
>
>
>
> public void setEMWPHpound(java.math.BigDecimal eMWPHpound) {
>
> writeProperty("eMWPHpound", eMWPHpound);
>
> }
>
> public java.math.BigDecimal getEMWPHpound() {
>
> return (java.math.BigDecimal)readProperty("eMWPHpound");
>
> }
>
>
>
> public void setEmdep4(java.math.BigDecimal emdep4) {
>
> writeProperty("emdep4", emdep4);
>
> }
>
> public java.math.BigDecimal getEmdep4() {
>
> return (java.math.BigDecimal)readProperty("emdep4");
>
> }
>
>
>
> public void setEmyfnm(String emyfnm) {
>
> writeProperty("emyfnm", emyfnm);
>
> }
>
> public String getEmyfnm() {
>
> return (String)readProperty("emyfnm");
>
> }
>
>
>
> public void setEmylnm(String emylnm) {
>
> writeProperty("emylnm", emylnm);
>
> }
>
> public String getEmylnm() {
>
> return (String)readProperty("emylnm");
>
> }
>
>
>
> }
>
> Here is my second table
>
> package stemc.cayenne.as400.auto;
>
>
> /** Class _Bprppcp was generated by Cayenne.
>
> * It is probably a good idea to avoid changing this class manually,
>
> * since it may be overwritten next time code is regenerated.
>
> * If you need to make any customizations, please use subclass.
>
> */
>
> public class _Bprppcp extends org.objectstyle.cayenne.CayenneDataObject {
>
>
> public static final String P_CHSPPOUND_PROPERTY = "pCHSPpound";
>
> public static final String PCDEP4_PROPERTY = "pcdep4";
>
> public static final String PCLDDS_PROPERTY = "pcldds";
>
>
> public static final String PCDEP4_PK_COLUMN = "PCDEP4";
>
> public static final String PCHSPPOUND_PK_COLUMN = "PCHSP#";
>
>
> public void setPCHSPpound(java.math.BigDecimal pCHSPpound) {
>
> writeProperty("pCHSPpound", pCHSPpound);
>
> }
>
> public java.math.BigDecimal getPCHSPpound() {
>
> return (java.math.BigDecimal)readProperty("pCHSPpound");
>
> }
>
>
>
> public void setPcdep4(java.math.BigDecimal pcdep4) {
>
> writeProperty("pcdep4", pcdep4);
>
> }
>
> public java.math.BigDecimal getPcdep4() {
>
> return (java.math.BigDecimal)readProperty("pcdep4");
>
> }
>
>
>
> public void setPcldds(String pcldds) {
>
> writeProperty("pcldds", pcldds);
>
> }
>
> public String getPcldds() {
>
> return (String)readProperty("pcldds");
>
> }
>
>
>
> }
>
>

Re: How do I retrieve a record with two fields for PK

Posted by Juergen Saar <ju...@jsaar.org>.
*** RTFM ***

*objectForPK<file:///home/saar/docs/cayenne_1.1/api/cayenne/org/objectstyle/cayenne/DataObjectUtils.html#objectForPK%28org.objectstyle.cayenne.access.DataContext,%20java.lang.Class,%20java.util.Map%29>
*(DataContext<file:///home/saar/docs/cayenne_1.1/api/cayenne/org/objectstyle/cayenne/access/DataContext.html>
context,
java.lang.Class dataObjectClass, java.util.Map pk)


2007/2/14, Frank <fa...@hotmail.com>:
>
> Hello,
>
> I have this defined:
> DataContext context = DataContext.getThreadDataContext();
> Bsypemp emp = null;
> emp = (Bsypemp) DataObjectUtils.objectForPK(context, Bsypemp.class, id);
>
> my problem is that the PK consists of two fields EMHSP# & EMEMP
>
> What is the correct syntax for getting a record?
>
> Thanks
>
> Frank
>

How to query a relationship

Posted by Frank <fa...@hotmail.com>.
Hello,

I have as AS400 relationship defined between two tables.
I need to include a column from the second table in my list.

Here is my error:
No matching getter method found for property Pcldds on class 
stemc.cayenne.as400.Bsypemp

Thanks
Frank

Here is my query:
Expression e = ExpressionFactory.matchDbExp

(Bsypemp.EMHSPPOUND_PK_COLUMN, new Integer(1));

e = e.andExp(ExpressionFactory.likeExp(Bsypemp.EMYLNM_PROPERTY, lname

+"%"));


SelectQuery query = new SelectQuery(Bsypemp.class,e);

List records = context.performQuery(query);

Here is my first table:
package stemc.cayenne.as400.auto;


/** Class _Bsypemp was generated by Cayenne.

* It is probably a good idea to avoid changing this class manually,

* since it may be overwritten next time code is regenerated.

* If you need to make any customizations, please use subclass.

*/

public class _Bsypemp extends org.objectstyle.cayenne.CayenneDataObject {


public static final String E_MEMPPOUND_PROPERTY = "eMEMPpound";

public static final String E_MHSPPOUND_PROPERTY = "eMHSPpound";

public static final String E_MWPHPOUND_PROPERTY = "eMWPHpound";

public static final String EMDEP4_PROPERTY = "emdep4";

public static final String EMYFNM_PROPERTY = "emyfnm";

public static final String EMYLNM_PROPERTY = "emylnm";


public static final String EMEMPPOUND_PK_COLUMN = "EMEMP#";

public static final String EMHSPPOUND_PK_COLUMN = "EMHSP#";


public void setEMEMPpound(java.math.BigDecimal eMEMPpound) {

writeProperty("eMEMPpound", eMEMPpound);

}

public java.math.BigDecimal getEMEMPpound() {

return (java.math.BigDecimal)readProperty("eMEMPpound");

}



public void setEMHSPpound(java.math.BigDecimal eMHSPpound) {

writeProperty("eMHSPpound", eMHSPpound);

}

public java.math.BigDecimal getEMHSPpound() {

return (java.math.BigDecimal)readProperty("eMHSPpound");

}



public void setEMWPHpound(java.math.BigDecimal eMWPHpound) {

writeProperty("eMWPHpound", eMWPHpound);

}

public java.math.BigDecimal getEMWPHpound() {

return (java.math.BigDecimal)readProperty("eMWPHpound");

}



public void setEmdep4(java.math.BigDecimal emdep4) {

writeProperty("emdep4", emdep4);

}

public java.math.BigDecimal getEmdep4() {

return (java.math.BigDecimal)readProperty("emdep4");

}



public void setEmyfnm(String emyfnm) {

writeProperty("emyfnm", emyfnm);

}

public String getEmyfnm() {

return (String)readProperty("emyfnm");

}



public void setEmylnm(String emylnm) {

writeProperty("emylnm", emylnm);

}

public String getEmylnm() {

return (String)readProperty("emylnm");

}



}

Here is my second table

package stemc.cayenne.as400.auto;


/** Class _Bprppcp was generated by Cayenne.

* It is probably a good idea to avoid changing this class manually,

* since it may be overwritten next time code is regenerated.

* If you need to make any customizations, please use subclass.

*/

public class _Bprppcp extends org.objectstyle.cayenne.CayenneDataObject {


public static final String P_CHSPPOUND_PROPERTY = "pCHSPpound";

public static final String PCDEP4_PROPERTY = "pcdep4";

public static final String PCLDDS_PROPERTY = "pcldds";


public static final String PCDEP4_PK_COLUMN = "PCDEP4";

public static final String PCHSPPOUND_PK_COLUMN = "PCHSP#";


public void setPCHSPpound(java.math.BigDecimal pCHSPpound) {

writeProperty("pCHSPpound", pCHSPpound);

}

public java.math.BigDecimal getPCHSPpound() {

return (java.math.BigDecimal)readProperty("pCHSPpound");

}



public void setPcdep4(java.math.BigDecimal pcdep4) {

writeProperty("pcdep4", pcdep4);

}

public java.math.BigDecimal getPcdep4() {

return (java.math.BigDecimal)readProperty("pcdep4");

}



public void setPcldds(String pcldds) {

writeProperty("pcldds", pcldds);

}

public String getPcldds() {

return (String)readProperty("pcldds");

}



}


Re: OutOfMemoryErrors

Posted by Frank <fa...@hotmail.com>.
I used your expression to locate records.
It returned
returned 2684 rows. - took 2880 ms.

which caused an OutOfMemory error. Java heap space.

I'll check on the suggestions you made.

Thanks

Frank

----- Original Message ----- 
From: "Andrus Adamchik" <an...@objectstyle.org>
To: <us...@cayenne.apache.org>
Sent: Wednesday, February 14, 2007 9:57 AM
Subject: OutOfMemoryErrors


> Frank,
> 
> thanks for confirming the fix. Also please send a message with a  
> different subject whenever you start a new topic (I changed the reply  
> subject to reflect the changing topic).
> 
> Now, OutOfMemoryErrors... There are two ways to address them:
> 
> 1. increase the available heap size:
> 
> http://www.objectstyle.org/cayenne/lists/cayenne-user/2005/10/0098.html
> 
> 2. use less memory. i.e. check how many objects your queries return.  
> If it is in the tens or hundreds of thousands you may need to think  
> of redesigning your app or use result iterator, or paginated queries,  
> whichever is more appropriate in your case:
> 
> http://cayenne.apache.org/doc/iterating-through-data-rows.html
> http://cayenne.apache.org/doc/paginated-queries.html
> 
> Andrus
> 
> 
> On Feb 14, 2007, at 9:34 AM, Frank wrote:
>> Hi Andrus,
>>
>> I regenerated the code and eclipse does not complain about source  
>> errors.
>> I am still having problems, but since I am new to Cayenne, it just  
>> may be a coding issue:
>> When I attempt to retrieve some records, I get this error:
>>
>> javax.servlet.ServletException: Servlet execution threw an exception
>> net.sf.click.extras.cayenne.DataContextFilter.doFilter 
>> (DataContextFilter.java:125)java.lang.OutOfMemoryError: Java heap  
>> spaceHere is my code:private List filterEmployees(String lname,  
>> String fname) {     DataContext context =  
>> DataContext.getThreadDataContext();     Expression qualifier1  
>> =ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYFNM_PROPERTY,fname 
>> +"%");     Expression qualifier2  
>> =ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYLNM_PROPERTY,lname 
>> +"%");     SelectQuery query = new SelectQuery 
>> (Bsypemp.class,qualifier2);     List records = context.performQuery 
>> (query);     return records;    }ThanksFrank
> 
>

Re: OutOfMemoryErrors

Posted by Frank <fa...@hotmail.com>.
ok, thanks you

Frank
----- Original Message ----- 
From: "Andrus Adamchik" <an...@objectstyle.org>
To: <us...@cayenne.apache.org>
Sent: Wednesday, February 14, 2007 9:57 AM
Subject: OutOfMemoryErrors


> Frank,
> 
> thanks for confirming the fix. Also please send a message with a  
> different subject whenever you start a new topic (I changed the reply  
> subject to reflect the changing topic).
> 
> Now, OutOfMemoryErrors... There are two ways to address them:
> 
> 1. increase the available heap size:
> 
> http://www.objectstyle.org/cayenne/lists/cayenne-user/2005/10/0098.html
> 
> 2. use less memory. i.e. check how many objects your queries return.  
> If it is in the tens or hundreds of thousands you may need to think  
> of redesigning your app or use result iterator, or paginated queries,  
> whichever is more appropriate in your case:
> 
> http://cayenne.apache.org/doc/iterating-through-data-rows.html
> http://cayenne.apache.org/doc/paginated-queries.html
> 
> Andrus
> 
> 
> On Feb 14, 2007, at 9:34 AM, Frank wrote:
>> Hi Andrus,
>>
>> I regenerated the code and eclipse does not complain about source  
>> errors.
>> I am still having problems, but since I am new to Cayenne, it just  
>> may be a coding issue:
>> When I attempt to retrieve some records, I get this error:
>>
>> javax.servlet.ServletException: Servlet execution threw an exception
>> net.sf.click.extras.cayenne.DataContextFilter.doFilter 
>> (DataContextFilter.java:125)java.lang.OutOfMemoryError: Java heap  
>> spaceHere is my code:private List filterEmployees(String lname,  
>> String fname) {     DataContext context =  
>> DataContext.getThreadDataContext();     Expression qualifier1  
>> =ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYFNM_PROPERTY,fname 
>> +"%");     Expression qualifier2  
>> =ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYLNM_PROPERTY,lname 
>> +"%");     SelectQuery query = new SelectQuery 
>> (Bsypemp.class,qualifier2);     List records = context.performQuery 
>> (query);     return records;    }ThanksFrank
> 
>

How do I retrieve a record with two fields for PK

Posted by Frank <fa...@hotmail.com>.
Hello,

I have this defined:
DataContext context = DataContext.getThreadDataContext();     
Bsypemp emp = null;
emp = (Bsypemp) DataObjectUtils.objectForPK(context, Bsypemp.class, id);

my problem is that the PK consists of two fields EMHSP# & EMEMP

What is the correct syntax for getting a record?

Thanks

Frank

Re: OutOfMemoryErrors (solved)

Posted by Frank <fa...@hotmail.com>.
Hi Andrus,

I bumped the JVM up to 512m
This resolved my issue.
I also removed AS400 fields not needed in my query to help reduce memory 
requirements.

Regards,

Frank 


OutOfMemoryErrors

Posted by Andrus Adamchik <an...@objectstyle.org>.
Frank,

thanks for confirming the fix. Also please send a message with a  
different subject whenever you start a new topic (I changed the reply  
subject to reflect the changing topic).

Now, OutOfMemoryErrors... There are two ways to address them:

1. increase the available heap size:

http://www.objectstyle.org/cayenne/lists/cayenne-user/2005/10/0098.html

2. use less memory. i.e. check how many objects your queries return.  
If it is in the tens or hundreds of thousands you may need to think  
of redesigning your app or use result iterator, or paginated queries,  
whichever is more appropriate in your case:

http://cayenne.apache.org/doc/iterating-through-data-rows.html
http://cayenne.apache.org/doc/paginated-queries.html

Andrus


On Feb 14, 2007, at 9:34 AM, Frank wrote:
> Hi Andrus,
>
> I regenerated the code and eclipse does not complain about source  
> errors.
> I am still having problems, but since I am new to Cayenne, it just  
> may be a coding issue:
> When I attempt to retrieve some records, I get this error:
>
> javax.servlet.ServletException: Servlet execution threw an exception
> net.sf.click.extras.cayenne.DataContextFilter.doFilter 
> (DataContextFilter.java:125)java.lang.OutOfMemoryError: Java heap  
> spaceHere is my code:private List filterEmployees(String lname,  
> String fname) {     DataContext context =  
> DataContext.getThreadDataContext();     Expression qualifier1  
> =ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYFNM_PROPERTY,fname 
> +"%");     Expression qualifier2  
> =ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYLNM_PROPERTY,lname 
> +"%");     SelectQuery query = new SelectQuery 
> (Bsypemp.class,qualifier2);     List records = context.performQuery 
> (query);     return records;    }ThanksFrank


Re: How do you deal with AS400 schemas

Posted by Frank <fa...@hotmail.com>.
Hi Andrus,

I regenerated the code and eclipse does not complain about source errors.
I am still having problems, but since I am new to Cayenne, it just may be a 
coding issue:
When I attempt to retrieve some records, I get this error:

javax.servlet.ServletException: Servlet execution threw an exception
 net.sf.click.extras.cayenne.DataContextFilter.doFilter(DataContextFilter.java:125)java.lang.OutOfMemoryError: Java heap spaceHere is my code:private List filterEmployees(String lname, String fname) {     DataContext context = DataContext.getThreadDataContext();     Expression qualifier1 =ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYFNM_PROPERTY,fname+"%");     Expression qualifier2 =ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYLNM_PROPERTY,lname+"%");     SelectQuery query = new SelectQuery(Bsypemp.class,qualifier2);     List records = context.performQuery(query);     return records;    }ThanksFrank

Re: How do you deal with AS400 schemas

Posted by Frank <fa...@hotmail.com>.
Hi Andrus,
I am running into another problem when I try to query the PK's
My the look of the map generated, it looks like Cayenne is not removing the 
# for the PK's

here is a snapshot;

 public static final String E_MEMPPOUND_PROPERTY = "eMEMPpound";
    public static final String E_MWPHPOUND_PROPERTY = "eMWPHpound";
    public static final String EMOTSH_PROPERTY = "emotsh";
    public static final String EMSCH_PROPERTY = "emsch";
    public static final String EMYFNM_PROPERTY = "emyfnm";
    public static final String EMYLNM_PROPERTY = "emylnm";
    public static final String DEPARTMENTS_PROPERTY = "departments";

    public static final String EMEMPPOUND_PK_COLUMN = "EMEMP#";
    public static final String EMHSPPOUND_PK_COLUMN = "EMHSP#";

Maybe I am just doing something wrong, but wanted to let you know.

Frank
----- Original Message ----- 
From: "Andrus Adamchik" <an...@objectstyle.org>
To: <us...@cayenne.apache.org>
Sent: Tuesday, February 13, 2007 6:26 PM
Subject: Re: How do you deal with AS400 schemas


> Frank,
>
> I put a patched version of Cayenne 1.2 here:
>
> http://people.apache.org/~aadamchik/patched/cayenne-1.2-dev- 
> win-02132007.zip
>
> Could you please give it a try and report how it worked? If it does,  I'll 
> commit the fix, and it will be available officially in the  future 
> versions of Cayenne.
>
> Thanks
> Andrus
>
>
>
> On Feb 13, 2007, at 11:51 AM, Frank wrote:
>
>> Hi Andrus,
>>
>> I have submitted this as a open a bug report.
>>
>> Frank
>>
>> ----- Original Message ----- From: "Andrus Adamchik" 
>> <an...@objectstyle.org>
>> To: <us...@cayenne.apache.org>
>> Sent: Tuesday, February 13, 2007 11:40 AM
>> Subject: Re: How do you deal with AS400 schemas
>>
>>
>>> Hmm... I'd say this is a bug in Cayenne class generator. We need  to 
>>> replace non-java chars with something more appropriate. Could  you 
>>> please open a bug report:
>>> https://issues.apache.org/cayenne/
>>> Thanks
>>> Andrus
>>> On Feb 13, 2007, at 11:37 AM, Frank wrote:
>>>> Hello,
>>>> Cayenne is generating code that has # because our AS400 database 
>>>> tables use these as field names.
>>>> Severity and Description Path Resource Location Creation Time Id
>>>> Syntax error on token "Invalid Character", , expected jcdsurvey/ src/ 
>>>> stemc/cayenne/as400/auto _Bsypemp.java line 199  1171384311117 13668
>>>>
>>>> public static final String EMEMP#_PK_COLUMN = "EMEMP#";
>>>> public static final String EMHSP#_PK_COLUMN = "EMHSP#";
>>>>
>>>> Should I just use a Raw Sql?
>>>> I had to remove the # from the objEntity as Cayenne complained.
>>>>
>>>> Thanks
>>>>
>>>> Frank
>>>>
>>>
>>
>
> 


Re: How do you deal with AS400 schemas

Posted by Frank Rocco <fa...@hotmail.com>.
Hi Andrus,

Ok, I am home now and will try it out tomorrow.
Thanks for getting right on this.



Regards,

Frank Rocco
farocco@hotmail.com




>From: Andrus Adamchik <an...@objectstyle.org>
>Reply-To: user@cayenne.apache.org
>To: user@cayenne.apache.org
>Subject: Re: How do you deal with AS400 schemas
>Date: Tue, 13 Feb 2007 18:26:11 -0500
>
>Frank,
>
>I put a patched version of Cayenne 1.2 here:
>
>http://people.apache.org/~aadamchik/patched/cayenne-1.2-dev- 
>win-02132007.zip
>
>Could you please give it a try and report how it worked? If it does,  I'll 
>commit the fix, and it will be available officially in the  future versions 
>of Cayenne.
>
>Thanks
>Andrus
>
>
>
>On Feb 13, 2007, at 11:51 AM, Frank wrote:
>
>>Hi Andrus,
>>
>>I have submitted this as a open a bug report.
>>
>>Frank
>>
>>----- Original Message ----- From: "Andrus Adamchik"  
>><an...@objectstyle.org>
>>To: <us...@cayenne.apache.org>
>>Sent: Tuesday, February 13, 2007 11:40 AM
>>Subject: Re: How do you deal with AS400 schemas
>>
>>
>>>Hmm... I'd say this is a bug in Cayenne class generator. We need  to  
>>>replace non-java chars with something more appropriate. Could  you  
>>>please open a bug report:
>>>https://issues.apache.org/cayenne/
>>>Thanks
>>>Andrus
>>>On Feb 13, 2007, at 11:37 AM, Frank wrote:
>>>>Hello,
>>>>Cayenne is generating code that has # because our AS400 database   
>>>>tables use these as field names.
>>>>Severity and Description Path Resource Location Creation Time Id
>>>>Syntax error on token "Invalid Character", , expected jcdsurvey/ src/ 
>>>>stemc/cayenne/as400/auto _Bsypemp.java line 199  1171384311117 13668
>>>>
>>>>public static final String EMEMP#_PK_COLUMN = "EMEMP#";
>>>>public static final String EMHSP#_PK_COLUMN = "EMHSP#";
>>>>
>>>>Should I just use a Raw Sql?
>>>>I had to remove the # from the objEntity as Cayenne complained.
>>>>
>>>>Thanks
>>>>
>>>>Frank
>>>>
>>>
>>
>



Re: How do you deal with AS400 schemas

Posted by Andrus Adamchik <an...@objectstyle.org>.
Frank,

I put a patched version of Cayenne 1.2 here:

http://people.apache.org/~aadamchik/patched/cayenne-1.2-dev- 
win-02132007.zip

Could you please give it a try and report how it worked? If it does,  
I'll commit the fix, and it will be available officially in the  
future versions of Cayenne.

Thanks
Andrus



On Feb 13, 2007, at 11:51 AM, Frank wrote:

> Hi Andrus,
>
> I have submitted this as a open a bug report.
>
> Frank
>
> ----- Original Message ----- From: "Andrus Adamchik"  
> <an...@objectstyle.org>
> To: <us...@cayenne.apache.org>
> Sent: Tuesday, February 13, 2007 11:40 AM
> Subject: Re: How do you deal with AS400 schemas
>
>
>> Hmm... I'd say this is a bug in Cayenne class generator. We need  
>> to  replace non-java chars with something more appropriate. Could  
>> you  please open a bug report:
>> https://issues.apache.org/cayenne/
>> Thanks
>> Andrus
>> On Feb 13, 2007, at 11:37 AM, Frank wrote:
>>> Hello,
>>> Cayenne is generating code that has # because our AS400 database   
>>> tables use these as field names.
>>> Severity and Description Path Resource Location Creation Time Id
>>> Syntax error on token "Invalid Character", , expected jcdsurvey/ 
>>> src/ stemc/cayenne/as400/auto _Bsypemp.java line 199  
>>> 1171384311117 13668
>>>
>>> public static final String EMEMP#_PK_COLUMN = "EMEMP#";
>>> public static final String EMHSP#_PK_COLUMN = "EMHSP#";
>>>
>>> Should I just use a Raw Sql?
>>> I had to remove the # from the objEntity as Cayenne complained.
>>>
>>> Thanks
>>>
>>> Frank
>>>
>>
>


Re: How do you deal with AS400 schemas

Posted by Frank <fa...@hotmail.com>.
Hi Andrus,

I have submitted this as a open a bug report.

Frank

----- Original Message ----- 
From: "Andrus Adamchik" <an...@objectstyle.org>
To: <us...@cayenne.apache.org>
Sent: Tuesday, February 13, 2007 11:40 AM
Subject: Re: How do you deal with AS400 schemas


> Hmm... I'd say this is a bug in Cayenne class generator. We need to  
> replace non-java chars with something more appropriate. Could you  
> please open a bug report:
> 
> https://issues.apache.org/cayenne/
> 
> Thanks
> Andrus
> 
> 
> On Feb 13, 2007, at 11:37 AM, Frank wrote:
> 
>> Hello,
>> Cayenne is generating code that has # because our AS400 database  
>> tables use these as field names.
>> Severity and Description Path Resource Location Creation Time Id
>> Syntax error on token "Invalid Character", , expected jcdsurvey/src/ 
>> stemc/cayenne/as400/auto _Bsypemp.java line 199 1171384311117 13668
>>
>> public static final String EMEMP#_PK_COLUMN = "EMEMP#";
>> public static final String EMHSP#_PK_COLUMN = "EMHSP#";
>>
>> Should I just use a Raw Sql?
>> I had to remove the # from the objEntity as Cayenne complained.
>>
>> Thanks
>>
>> Frank
>>
> 
>

Re: How do you deal with AS400 schemas

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hmm... I'd say this is a bug in Cayenne class generator. We need to  
replace non-java chars with something more appropriate. Could you  
please open a bug report:

https://issues.apache.org/cayenne/

Thanks
Andrus


On Feb 13, 2007, at 11:37 AM, Frank wrote:

> Hello,
> Cayenne is generating code that has # because our AS400 database  
> tables use these as field names.
> Severity and Description Path Resource Location Creation Time Id
> Syntax error on token "Invalid Character", , expected jcdsurvey/src/ 
> stemc/cayenne/as400/auto _Bsypemp.java line 199 1171384311117 13668
>
> public static final String EMEMP#_PK_COLUMN = "EMEMP#";
> public static final String EMHSP#_PK_COLUMN = "EMHSP#";
>
> Should I just use a Raw Sql?
> I had to remove the # from the objEntity as Cayenne complained.
>
> Thanks
>
> Frank
>


How do you deal with AS400 schemas

Posted by Frank <fa...@hotmail.com>.
Hello,
Cayenne is generating code that has # because our AS400 database tables use 
these as field names.
Severity and Description Path Resource Location Creation Time Id
Syntax error on token "Invalid Character", , expected 
jcdsurvey/src/stemc/cayenne/as400/auto _Bsypemp.java line 199 1171384311117 
13668

public static final String EMEMP#_PK_COLUMN = "EMEMP#";
public static final String EMHSP#_PK_COLUMN = "EMHSP#";

Should I just use a Raw Sql?
I had to remove the # from the objEntity as Cayenne complained.

Thanks

Frank 


Re: getting bad connection

Posted by Andrus Adamchik <an...@objectstyle.org>.
Frank,

> after a number of calls, it fails.

it would help if you provide the details of your problems, like  
Exception stack traces.

My guess will be that you are not closing the connections\. You must  
call Connection.close() every time after you finish working with a  
connection.

Andrus


On Feb 13, 2007, at 11:14 AM, Frank wrote:
> Hello,
>
> I have this in a class to return a Cayenne connection.
> It works ok at first, but after a number of calls, it fails.
>
> public class DBConnections {....
> public Connection getAS400Connection() {
> try {
>     Configuration config = Configuration.getSharedConfiguration();
>     DataDomain domain = config.getDomain();
>     DataNode node = domain.getNode("cdsurveyDomainNode1");
>     return node.getDataSource().getConnection();
>  } catch (Exception ex) {
>   return null;
>  }
> }
>
> Thanks
>
> Frank
>


getting bad connection

Posted by Frank <fa...@hotmail.com>.
Hello,

I have this in a class to return a Cayenne connection.
It works ok at first, but after a number of calls, it fails.

public class DBConnections {....
public Connection getAS400Connection() {
try {
     Configuration config = Configuration.getSharedConfiguration();
     DataDomain domain = config.getDomain();
     DataNode node = domain.getNode("cdsurveyDomainNode1");
     return node.getDataSource().getConnection();
  } catch (Exception ex) {
   return null;
  }
 }

Thanks

Frank

Re: cayenne with jetty6

Posted by Andrus Adamchik <an...@objectstyle.org>.

On Feb 13, 2007, at 10:48 AM, Andrus Adamchik wrote:
>> perhaps someone could add the docs http://cayenne.apache.org/doc/ 
>> tutorial-webapp.html with some usefull information about jetty6.
>
> I don't think this is Jetty6-related at all.

Although providing a sample Jetty JNDI DataSource configuration that  
is NOT using Cayenne preferences is probably a good idea. A similar  
configuration for Tomcat is available here:

http://cayenne.apache.org/doc/using-jndi.html

I don't have a sample handy. Anyone can fill it in?

Andrus




help with AS400 call

Posted by Frank <fa...@hotmail.com>.
Hello,

I have the followign defined as a Raw Sql in Cayenne

SELECT BSYDTAA.BSYPEMP.EMYLNM, BSYDTAA.BSYPEMP.EMYFNM, 
BSYDTAC.BPRPPCP.PCDEP4, BSYDTAC.BPRPPCP.PCLDDS, BSYDTAA.BSYPEMP.EMEMP# AS 
EMEMP, BSYDTAA.BSYPEMP.EMWPH# AS WPHONE FROM BSYDTAA.BSYPEMP, 
BSYDTAC.BPRPPCP WHERE BSYDTAA.BSYPEMP.EMHSP# = BSYDTAC.BPRPPCP.PCHSP# AND 
BSYDTAA.BSYPEMP.EMDEP4 = BSYDTAC.BPRPPCP.PCDEP4 AND (BSYDTAA.BSYPEMP.EMHSP# 
IN (1,5)) AND (BSYDTAA.BSYPEMP.EMDOT=0)
AND EMYLNM like ?
AND EMYFNM like ?
ORDER BY EMYLNM

I am trying something like this, but it is not working:

DataContext context = DataContext.getThreadDataContext();

Expression qualifier1 = 
ExpressionFactory.likeIgnoreCaseExp(Employees.EMYFNM_PROPERTY,fname+"%");

Expression qualifier2 = 
ExpressionFactory.likeIgnoreCaseExp(Employees.EMYLNM_PROPERTY,lname+"%");

SelectQuery query = new SelectQuery(Bsypemp.class,qualifier2);

List records = context.performQuery(query);

What am I doing wrong?
Thanks
Frank


Re: cayenne with jetty6

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Peter,

[I stripped message that you quote, since it has no relation to the  
topic you started.]

> perhaps someone could add the docs http://cayenne.apache.org/doc/ 
> tutorial-webapp.html with some usefull information about jetty6.

I don't think this is Jetty6-related at all.

> even with including all dependencies to the jetty-plugin i failed  
> to use the jndi-backup-mechanism, wich i use successfully witch the  
> jetty-launcher.

Anything is printed on the console during startup that can shed the  
light on the problem?

A few things can go wrong:

* cayenne-modeler.jar and hsqldb.jar can be missing from dependencies  
(although your message implies they are not)

* Sometimes local preferences database gets corrupted (it is a long- 
standing issue that requires some serious modeler rework, switching  
from HSQLDB to Derby or something else more reliable). The workaround  
is to delete the preferences directory ($HOME/.cayenne/prefs), and  
recreate the data sources from scratch.

Andrus


On Feb 13, 2007, at 6:10 AM, Peter Schröder wrote:
> hi there,
>
> i was trying to run the cayenne-filter with jetty6-maven-plugin,  
> but it did not work out for me...
> even with including all dependencies to the jetty-plugin i failed  
> to use the jndi-backup-mechanism, wich i use successfully witch the  
> jetty-launcher.
>
> perhaps someone could add the docs http://cayenne.apache.org/doc/ 
> tutorial-webapp.html with some usefull information about jetty6.
>
> kind regards,
> peter