|
Sponsored Links
Resources
Enterprise Java Research Library
Get Java white papers, product information, case studies and webcasts
|
News
News
News
|
Messages: 19
Messages: 19
Messages: 19
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
TSS Article: Object Relational Mapping with Cayenne
Andrus Adamchik and Eric Schneider present Cayenne - an open source Object Relational Mapping (ORM) framework. Cayenne is an integrated suite that includes modeling and deployment tools. This article introduces some of Cayenne's features, and shows how to quickly create an ORM application.
Read Cayenne: Being Productive with Object Relational Mapping
|
|
Message #124382
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
I like the looks of this.
It seems wel done on first glance. Has anyone compared it with Hibernate, on a feature-by-feature basis, as well as looking at how the two perform? Is there a direct code comparison from the client side?
|
|
Message #124403
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
distributed cache
So, does the distributed cache make any attempt to coordinate updates, or is it a simple last-save-wins approach? It seems like all of the open source distributed cache systems work that way, except for the JBoss one that uses JTA transactions.
|
|
Message #124405
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
distributed cache
You are right - we do not attempt to implement our own distributed transactions. If you need them, use container features - Cayenne allows that.
I personally prefer "disconnected" objects and optimistic locking to some sort of coordinated distributed long running transaction monstrosity. Staying as simple and lightweight as your system allows...
Andrus
|
|
Message #124407
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
I like the looks of this.
> Is there a direct code comparison from the client side?
I would like to see one myself, as this is being asked pretty often. Besides it is always good to know your own strengths and weeknesses compared to others.
My opinion (actually expressed in the article pretty well) is that ORM in Java is quickly reaching a point of becoming a commodity meaning that most of the first tier tools have all the needed features. So it all comes down to the flavor... :-)
Andrus
|
|
Message #124409
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
happy user
Having experience with WebObjects/EOF, I started using cayenne one year ago. It was really easy to get started, and I think it is a lot better than EOF. Cayenne is more straight forward than EOF and the open source nature of cayenne is gold.
I am currently using cayenne in two projects. One developed from the ground up with cayenne and one project upgraded to cayenne that did not use a ORM at all. I will use cayenne in my next projects as well.
The code is robust and the developers are really fixing bugs! My favorite new function in cayenne 1.1 is the new cache for all DataContexts inside a single java vm. I am not using the shared cache. The feature I am missing most is the ability to prefetch across a flattened many-to-many relationship.
|
|
Message #124433
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Use with Spring?
Cayenne can be used with Spring pretty much out of the box. Cayenne has its own access stack, configured via CayenneModeler. All that is needed is to "mount" a Configuration object singleton in Spring, and use it as a source of DataContexts for sessions. I may write a simple factory making the process more transparent, unless somebody contributes it before I do it :-)
I guess more complex scenarios may benefit from some of the Spring features. I can think of automatically assigning an appropriate DataDomain to a user session based on some security token. But then 99% of Cayenne apps just use a single DataDomain.
Andrus
|
|
Message #124442
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
happy user
+1 from me ... as an ex-WO user, I've been using Cayenne in combination with Tapestry and am very happy with it.
|
|
Message #124459
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Cayenne vs. Hibernate
public class _Artist extends org.objectstyle.cayenne.CayenneDataObject {...
..that's one advantage of Hibernate over Cayenne! Of course otherwise Cayenne may have better/easier qualities over Hibernate.
|
|
Message #124471
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Cayenne and session replication
One of the problems I had with cayenne (I'm using 1.0 release) is that it doesn't allow deploying with session replication. What happens is that cayenne sessions seem to be locked with database connections. Now, if one servlet container dies and the other tries to use the replicated cayenne objects it gives a "global exception" because the db connection is not valid. It also happen when (I tried it for testing purpose) the db is shut down and restarted. Also, when this happen, cayenne cannot be reset in any way, you have to reset your app server/servlet container. Has anyone found a workaround for this?
|
|
Message #124490
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
I like the looks of this.
Kudos to Andrus Adamchik and Eric Schneider. This is really great stuff.
Nice to have an alternative to Hibernate which, imho, is going the wrong way as JBoss will drive its development from now on.
Hurray for simplicity.
|
|
Message #124502
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Cayenne and session replication
> One of the problems I had with cayenne (I'm using 1.0 release) > is that it doesn't allow deploying with session replication.
Session replication should work just fine, even in 1.0. A number of Cayenne applications were deployed using replication. So if you have any problems, please submit a bug report with details via JIRA on our site.
> What happens is that cayenne sessions seem > to be locked with database connections.
This is strange - the whole point is that DataContext is "disconnected", so it can be deserialized and attached to any other Cayenne stack.
Andrus
|
|
Message #124573
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
el
Have you considered to release Cayenne expression language independently? It would make an alternative to OGNL and XPath (as used by Jakarta JXPath). Cayenne looks nice. I'll play with it. Thanks for the article.
|
|
Message #124581
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Cayenne and session replication
... the whole point is that DataContext is "disconnected", so it can be deserialized and attached to any other Cayenne stack. Andrus Ok, the problem was probably in storing DataObjects in session (for caching purposes). I think I should just avoid doing this, correct?
|
|
Message #124597
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
el
I actually like Cayenne expressions package a lot. This is my personal favorite feature in Cayenne 1.1. Among other things it allowed us to refactor (throw out) tons of internal code that was doing manual property and metadata navigation.
Well, sometimes I think that a standalone expressions distro is a good idea. But my current opinion is that it is not worth it (and I haven't heard otherwise from other committers). There are a few reasons:
1. I personally have no interest in maintaining such standalone package, and have no goal to compete with OGNL. I'd rather continue developing Cayenne and compete with Hibernate :-)
2. There are cool "db:" expressions, that probably don't make sense outside Cayenne.
3. The scope of the expressions package actually maps to common SQL conditions and arithmetic operations.
So there is a synergy with the rest of Cayenne, and making it more generic than it is may hurt that.
Andrus
|
|
Message #124598
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Cayenne and session replication
Ok, the problem was probably in storing DataObjects in session (for caching purposes). I think I should just avoid doing this, correct? Well, I can see how this can screw up deserialization in theory. If you have concrete examples with exception stack, please still open a bug report.
Andrus
|
|
Message #125130
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
my experience has been good
I've been using Cayenne with Tapestry, and I am quite pleased with it. The architecture feels quite elegant to me, the mailing list is friendly and helpful, and bugs are rare (and fixed quickly in any case).
|
|
Message #146708
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Cayenne is invasive and non POJO isn't it?
It seems to me that Cayenne is one of the "invasive" bunch of persistence mechanisms. It requires your data objects to inherit from a common superclass and requires them to conform to a particular style (which is most easily produced using their mapping tool). It claims to be able to persist "POJO"s, but they don't mean the same thing as I do when they say that. For me a POJO might look like this:
class Fred { String id; String name; int value; }
If my persistence tool can persist a POJO then it ought to be able to persist instances of this class unmodified. Hibernate can do this. So can TopLink. Cayenne can't. JDO can (but only by groping my class when I'm not looking).
Huw
|
|
 |
New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com |
 |
 |
Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6.
(November 2, Article)
SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options.
(September 28, Article)
Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team.
(September 22, Article)
Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies.
(July 14, Article)
JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags.
(June 29, Article)
In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project.
(June 23, Tech Talk)
Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now.
(June 15, Tech Talk)
In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements.
(June 15, Tech Talk)
In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls.
(June 4, Tech Talk)
Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable.
(May 28, Tech Talk)
This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work.
(May 26, Tech Talk)
Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers.
(May 21, Tech Talk)
Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application.
(May 19, Article)
In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources.
(May 19, Tech Talk)
Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)
The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)
|
|