Gary Jarrel | 6 Aug 2010 06:10
Picon

Strange insertion of UPPER when Ordering by TIMESTAMP in SQL Server

Hi All

Using SQL Server I have a table with a DATETIME column. When I run a
Cayenne Query with an Oder By clause in Descending Mode, the resulting
SQL looks something like:

SELECT UPPER(t0.date_created)
FROM product t0
ORDER BY UPPER(t0.date_created) DESC

In the Modeler these columns show up as TIMESTAMP

Is there a reason a UPPER is being used, it seems like it's trying to
do a case insensitive ordering on a non character based column.

Thank you

Gary

Michael Gentry | 6 Aug 2010 14:35
Favicon

Re: Strange insertion of UPPER when Ordering by TIMESTAMP in SQL Server

Just curious, did you use SortOrder.DESCENDING_INSENSITIVE?

mrg

On Fri, Aug 6, 2010 at 12:10 AM, Gary Jarrel <garyjarrel <at> gmail.com> wrote:
> Hi All
>
> Using SQL Server I have a table with a DATETIME column. When I run a
> Cayenne Query with an Oder By clause in Descending Mode, the resulting
> SQL looks something like:
>
> SELECT UPPER(t0.date_created)
> FROM product t0
> ORDER BY UPPER(t0.date_created) DESC
>
> In the Modeler these columns show up as TIMESTAMP
>
> Is there a reason a UPPER is being used, it seems like it's trying to
> do a case insensitive ordering on a non character based column.
>
> Thank you
>
> Gary
>

Martin Weber | 8 Aug 2010 12:13
Picon

Web site link to example and a proposal for a new example link

Hi,

May I suggest to add the Apache Cayenne examples below the success 
stories on the main page or within the success stories. The examples are 
quite hard to find (it's referenced on the cwiki index page) and I could 
find it only through google for apache cayenne examples.

If possible, somebody could add the link to my project as a further 
example of using cayenne within different technology setups. A link to 
http://yafra.sourceforge.net/ would be excellent. It is yet another 
framework, but not in fact to be reused as such, more to get / take what 
you need to have a better learning curve.

I used cayenne with the DTO pattern within EJB3 setup serving an Eclipse 
RCP EJB3 fat client (using Apache OpenEJB). As well a small example 
using Apache Wicket with Cayenne. Working on a Google Web Toolkit 
example and would like to move on to Eclipse Riena using distributed 
OSGi (they use Hessian as well, seems to be an interesting example). 
With the yafra framework I did already a ROP example, but not yet 
published. All sources are under SVN as Eclipse projects. I use Trac to 
document.

You can follow twitter yafraorg or contact yafraorg <at> gmail.com.

Cheers,
Martin

Andrus Adamchik | 8 Aug 2010 20:59
Favicon

Re: Web site link to example and a proposal for a new example link

Hi Martin,

> May I suggest to add the Apache Cayenne examples below the success  
> stories on the main page or within the success stories. The examples  
> are quite hard to find (it's referenced on the cwiki index page) and  
> I could find it only through google for apache cayenne examples.

I don't think examples belong on success stories page, as the purpose  
of the later is quite different - to highlight the use of Cayenne on  
some real-life projects. But answering your general point... The  
problem with the examples on cwiki, namely this link -
https://cwiki.apache.org/CAY/cayenne-examples.html 
  , is that all of those are old, unmaintained (as a matter of fact I  
just removed/changed some links that no longer work), and many are  
likely obsolete.

This is a #1 link shown to me by Google when searching for "cayenne  
examples", so it is not hard to find per se, but the question is  
whether we want to endorse our old set of examples. I'd say them  
staying a step away from the main site is actually good in current  
situation :-)

> If possible, somebody could add the link to my project as a further  
> example of using cayenne within different technology setups. A link  
> to http://yafra.sourceforge.net/ would be excellent. It is yet  
> another framework, but not in fact to be reused as such, more to  
> get / take what you need to have a better learning curve.
>
> I used cayenne with the DTO pattern within EJB3 setup serving an  
> Eclipse RCP EJB3 fat client (using Apache OpenEJB). As well a small  
(Continue reading)

Martin Weber | 8 Aug 2010 22:16
Picon

Re: Web site link to example and a proposal for a new example link

Hi Andrus,

agree with your point, wrong location and it is easy to find it in 
google. I still think it would be worth adding a link to 
http://yafra.sourceforge.net/ with a short description like "Using 
Cayenne within different java technologies - a jump start".

The whole framework is based on Apache Cayenne. My driving point was 
building different applications with a database as central back end. 
Apache Cayenne was the ORM of choice. Instead of building a concrete 
application to share with others, the idea came up to share all the 
findings and the chosen approaches as a sort of a framework. The 
framework shows how I embedded Apache Cayenne into Apache Wicket or in 
simple console/batch programs or with a fat client written in Eclipse 
RCP using EJB's (not using JPA) to access the Cayenne layer.

I will put some more effort into the trac sourceforge.net page to give a 
better understanding how yafra shall be used.

Hope it helps,
Cheers,
Martin

On 08.08.2010 20:59, Andrus Adamchik wrote:
> Hi Martin,
>
>> May I suggest to add the Apache Cayenne examples below the success
>> stories on the main page or within the success stories. The examples
>> are quite hard to find (it's referenced on the cwiki index page) and I
>> could find it only through google for apache cayenne examples.
(Continue reading)

Bruno René Santos | 9 Aug 2010 11:41
Picon

Rollbacks and Listeners

Hello all,

Im using cayenne on a banking system, where commits and rollbacks are critical.
I was thinking about using cayenne callbacks to include the creation of logs
during database operations. My doubt is what happens when there is a rollback on
the database during a transaction in terms of callbacks? Do all Pre... callbacks
are called but no Post.. callbacks? Is there any way to know on the callbacks
that the objects were rollbacked?

Regards

Bruno Santos

Andrey Razumovsky | 9 Aug 2010 12:16
Picon

Re: Rollbacks and Listeners

Hi,

Unless something's changed, callbacks are not called during callback. Also
note that only "post" callbacks can tell for sure that DB operations had
happened

2010/8/9 Bruno René Santos <brunorene <at> holos.pt>

> Hello all,
>
>
>
> Im using cayenne on a banking system, where commits and rollbacks are
> critical.
> I was thinking about using cayenne callbacks to include the creation of
> logs
> during database operations. My doubt is what happens when there is a
> rollback on
> the database during a transaction in terms of callbacks? Do all Pre...
> callbacks
> are called but no Post.. callbacks? Is there any way to know on the
> callbacks
> that the objects were rollbacked?
>
>
>
> Regards
>
> Bruno Santos
>
(Continue reading)

Andrey Razumovsky | 9 Aug 2010 12:16
Picon

Re: Rollbacks and Listeners

I meant

callbacks are not called during rollback :)

2010/8/9 Andrey Razumovsky <razumovsky.andrey <at> gmail.com>

> Hi,
>
> Unless something's changed, callbacks are not called during callback. Also
> note that only "post" callbacks can tell for sure that DB operations had
> happened
>
> 2010/8/9 Bruno René Santos <brunorene <at> holos.pt>
>
> Hello all,
>>
>>
>>
>> Im using cayenne on a banking system, where commits and rollbacks are
>> critical.
>> I was thinking about using cayenne callbacks to include the creation of
>> logs
>> during database operations. My doubt is what happens when there is a
>> rollback on
>> the database during a transaction in terms of callbacks? Do all Pre...
>> callbacks
>> are called but no Post.. callbacks? Is there any way to know on the
>> callbacks
>> that the objects were rollbacked?
>>
(Continue reading)

Andrus Adamchik | 9 Aug 2010 13:32
Favicon

Re: Web site link to example and a proposal for a new example link

Hi Martin,

I see. I guess the concept of a "framework as an example" wasn't  
immediately clear to me. Now I added a link to Yafra to the examples  
page. Thanks a lot for your work!

Andrus

On Aug 8, 2010, at 11:16 PM, Martin Weber wrote:
> Hi Andrus,
>
> agree with your point, wrong location and it is easy to find it in  
> google. I still think it would be worth adding a link to http://yafra.sourceforge.net/ 
>  with a short description like "Using Cayenne within different java  
> technologies - a jump start".
>
> The whole framework is based on Apache Cayenne. My driving point was  
> building different applications with a database as central back end.  
> Apache Cayenne was the ORM of choice. Instead of building a concrete  
> application to share with others, the idea came up to share all the  
> findings and the chosen approaches as a sort of a framework. The  
> framework shows how I embedded Apache Cayenne into Apache Wicket or  
> in simple console/batch programs or with a fat client written in  
> Eclipse RCP using EJB's (not using JPA) to access the Cayenne layer.
>
> I will put some more effort into the trac sourceforge.net page to  
> give a better understanding how yafra shall be used.
>
> Hope it helps,
> Cheers,
(Continue reading)

Mike Kienenberger | 9 Aug 2010 16:37
Picon

Re: Rollbacks and Listeners

On Mon, Aug 9, 2010 at 5:41 AM, Bruno René Santos <brunorene <at> holos.pt> wrote:
> Im using cayenne on a banking system, where commits and rollbacks are critical.
> I was thinking about using cayenne callbacks to include the creation of logs
> during database operations. My doubt is what happens when there is a rollback on
> the database during a transaction in terms of callbacks? Do all Pre... callbacks
> are called but no Post.. callbacks? Is there any way to know on the callbacks
> that the objects were rollbacked?

As long as you create the audit records in the same transaction as the
rest of the data, when the transaction is rolled back or committed,
then the audit logs will be rolled back or committed.   You should not
have to do anything on a Post, only on a Pre.

============

An old issue on auditing is here.   Not sure how relevant it is for
3.0 as I haven't used 3.0 yet.

https://issues.apache.org/jira/browse/CAY-414

Some newer threads on auditing:

http://mail-archives.apache.org/mod_mbox/cayenne-dev/200902.mbox/%3CB82E356A-3B9B-4D40-B767-2F7C863AAF77 <at> objectstyle.org%3E

Andrey posted one set of code for doing this here -- read through the
whole thread.

http://mail-archives.apache.org/mod_mbox/cayenne-user/200903.mbox/%3C3219fff70903240316o4644e474ia669ea819510ef9f <at> mail.gmail.com%3E

(Continue reading)


Gmane