<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>dev@cayenne.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/"/>
<id>http://mail-archives.apache.org/mod_mbox/cayenne-dev/</id>
<updated>2009-12-07T16:26:20Z</updated>
<entry>
<title>SQLTemplate for not object queries and NullPointerException</title>
<author><name>Evgeny Ryabitskiy &lt;evgeny.ryabitskiy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c9f90c2b60912070252i732dd5c0y13ecba5ce53954e3@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9f90c2b60912070252i732dd5c0y13ecba5ce53954e3@mail-gmail-com%3e</id>
<updated>2009-12-07T10:52:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Today I tried to use SQLTemplate for not object query (expecting to
get list of DataRows).

Here is what I did:

    public void testSQLTemplateForDataMapWithInsert() {
        DataMap testDataMap = context.getEntityResolver().getDataMap("testmap");
        String sql = "INSERT INTO ARTIST VALUES (15, 'Surikov', null)";
        SQLTemplate q1 = new SQLTemplate(testDataMap, sql);
        context.performNonSelectingQuery(q1);

        SQLTemplate q2 = new SQLTemplate(testDataMap, "SELECT * FROM ARTIST");
        List&lt;DataRow&gt; result = context.performQuery(q2);
        assertEquals(1, result.size());
    }

I got :

java.lang.NullPointerException
	at org.apache.cayenne.access.ObjectResolver.&lt;init&gt;(ObjectResolver.java:60)
	at org.apache.cayenne.access.DataDomainQueryAction$ObjectConversionStrategy.toObjects(DataDomainQueryAction.java:568)
	at org.apache.cayenne.access.DataDomainQueryAction$SingleObjectConversionStrategy.convert(DataDomainQueryAction.java:603)
	at org.apache.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:451)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:125)
	at org.apache.cayenne.access.UnitTestDomainQueryAction.execute(UnitTestDomainQueryAction.java:48)
	at org.apache.cayenne.access.UnitTestDomain.onQuery(UnitTestDomain.java:63)
	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:335)
	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1049)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1038)
	at org.apache.cayenne.query.SQLTemplateTest.testSQLTemplateForDataMapWithInsert(SQLTemplateTest.java:64)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


Going to create JIRA issue for it...

Evgeny.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: DI-based configuration works</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c0005E863-162A-48C9-BCDC-D0059E0806E6@objectstyle.org%3e"/>
<id>urn:uuid:%3c0005E863-162A-48C9-BCDC-D0059E0806E6@objectstyle-org%3e</id>
<updated>2009-12-06T23:26:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Forgot one more important new feature:

* Any Cayenne extensions provided by users in the XML (custom  
DbAdapters, DataSourceFactories, etc) are passed through an injector  
on creation, so they don't have to rely on app-specific kludges to  
obtain various environment services (e.g. ResourceLocator). So you can  
do something like this:

class MyDataSourceFactory implements DataSourceFactory {

   @Inject
   private ResourceLocator resourceLocator;

   @Inject
   private SomeofMyOnwServices service1;

   ...
}

Andrus

On Dec 6, 2009, at 6:20 PM, Andrus Adamchik wrote:

&gt; An update on the new DI configuration... The new DI stack is now  
&gt; usable as a fully functional alternative to Configuration. I created  
&gt; an integration test module [1], showing how Cayenne can be started  
&gt; using the new approach. Actually it is as simple as that:
&gt;
&gt; CayenneServerRuntime runtime = new CayenneServerRuntime(name.name());
&gt; ObjectContext context = runtime.newContext();
&gt;
&gt; BTW "Server" in runtime name implies that we should be able to build  
&gt; a "Client" runtime for ROP stack in the future (actually should be  
&gt; quite easy). Configuration is done in a DI "module" class. Here is a  
&gt; standard one that can be amended or partially overridden by the  
&gt; users - [2]. Some highlights:
&gt;
&gt; * The new configuration provides all the same functionality as the  
&gt; old one (except for JNDI preferences hack, which will turn into a  
&gt; first class feature once CAY-1327 is implemented).
&gt;
&gt; * The new configuration is using a single-domain format compatible  
&gt; with CAY-1318.
&gt;
&gt; * The new configuration loads descriptors from uniquely named files,  
&gt; such as "cayenne-stackname.xml, so there's no more single  
&gt; cayenne.xml file, and less chance of odd naming conflicts between  
&gt; multiple jars.
&gt;
&gt; * Rewrote a bunch of old configuration code, which is now so much  
&gt; cleaner, mainly due to the design with injection in mind. There are  
&gt; still some rough spots in the service definitions and some functions  
&gt; missing in DI that I'd like to have, but it fully works as is.
&gt;
&gt; * Better project model representation. I finally separated  
&gt; configuration objects (DataDomainDescriptor, DataNodeDescriptor)  
&gt; from runtime objects (DataDomain, DataNode). This made the runtime  
&gt; code cleaner, and also opens possibilities for cleaner Modeler code  
&gt; (currently there are lots of hacks to "edit" runtime objects).
&gt;
&gt; * Added a number of important pluggable abstractions [2], such as  
&gt; ResourceLocator.
&gt;
&gt; * Performance... I didn't see any difference in application startup  
&gt; time on a simple app between the new and the old stack.
&gt;
&gt; So the next step is to finish CAY-1318 (which is mainly about  
&gt; upgrading the old projects to the new format), and to do the switch  
&gt; to the new configuration. In terms of public API, I think that most  
&gt; of the classes in org.apache.cayenne.conf will have to go. There's  
&gt; no point in deprecating them (although I sort of did it in a few  
&gt; places already), as the framework will not use them at all. One  
&gt; possible interim step is moving all these classes from runtime jars  
&gt; to the Modeler, so that the Modeler could read older project files  
&gt; and perform needed upgrades. At a later point we may also refactor  
&gt; the Modeler to use the new configuration classes, as mentioned above.
&gt;
&gt; Also there's more work to be done to align the new config with the  
&gt; current config expectations (such as a singleton configuration...  
&gt; what do you think, do we need to keep it?? , provide an analog of  
&gt; FileConfiguration, etc.)
&gt;
&gt; Andrus
&gt;
&gt;
&gt; [1] http://fisheye6.atlassian.com/browse/cayenne/trunk/itests/cayenne-di-stack
&gt;
&gt; [2] http://fisheye6.atlassian.com/browse/cayenne/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneServerModule.java?r=HEAD&amp;content=true
&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>DI-based configuration works</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c6D780CA4-DC00-44FF-9C7D-8A8EAB1DC611@objectstyle.org%3e"/>
<id>urn:uuid:%3c6D780CA4-DC00-44FF-9C7D-8A8EAB1DC611@objectstyle-org%3e</id>
<updated>2009-12-06T23:20:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
An update on the new DI configuration... The new DI stack is now  
usable as a fully functional alternative to Configuration. I created  
an integration test module [1], showing how Cayenne can be started  
using the new approach. Actually it is as simple as that:

CayenneServerRuntime runtime = new CayenneServerRuntime(name.name());
ObjectContext context = runtime.newContext();

BTW "Server" in runtime name implies that we should be able to build a  
"Client" runtime for ROP stack in the future (actually should be quite  
easy). Configuration is done in a DI "module" class. Here is a  
standard one that can be amended or partially overridden by the users  
- [2]. Some highlights:

* The new configuration provides all the same functionality as the old  
one (except for JNDI preferences hack, which will turn into a first  
class feature once CAY-1327 is implemented).

* The new configuration is using a single-domain format compatible  
with CAY-1318.

* The new configuration loads descriptors from uniquely named files,  
such as "cayenne-stackname.xml, so there's no more single cayenne.xml  
file, and less chance of odd naming conflicts between multiple jars.

* Rewrote a bunch of old configuration code, which is now so much  
cleaner, mainly due to the design with injection in mind. There are  
still some rough spots in the service definitions and some functions  
missing in DI that I'd like to have, but it fully works as is.

* Better project model representation. I finally separated  
configuration objects (DataDomainDescriptor, DataNodeDescriptor) from  
runtime objects (DataDomain, DataNode). This made the runtime code  
cleaner, and also opens possibilities for cleaner Modeler code  
(currently there are lots of hacks to "edit" runtime objects).

* Added a number of important pluggable abstractions [2], such as  
ResourceLocator.

* Performance... I didn't see any difference in application startup  
time on a simple app between the new and the old stack.

So the next step is to finish CAY-1318 (which is mainly about  
upgrading the old projects to the new format), and to do the switch to  
the new configuration. In terms of public API, I think that most of  
the classes in org.apache.cayenne.conf will have to go. There's no  
point in deprecating them (although I sort of did it in a few places  
already), as the framework will not use them at all. One possible  
interim step is moving all these classes from runtime jars to the  
Modeler, so that the Modeler could read older project files and  
perform needed upgrades. At a later point we may also refactor the  
Modeler to use the new configuration classes, as mentioned above.

Also there's more work to be done to align the new config with the  
current config expectations (such as a singleton configuration... what  
do you think, do we need to keep it?? , provide an analog of  
FileConfiguration, etc.)

Andrus


[1] http://fisheye6.atlassian.com/browse/cayenne/trunk/itests/cayenne-di-stack

[2] http://fisheye6.atlassian.com/browse/cayenne/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneServerModule.java?r=HEAD&amp;content=true



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Tutorials</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3cB3B7A750-B4B3-4BFA-AF6E-98E58343C719@objectstyle.org%3e"/>
<id>urn:uuid:%3cB3B7A750-B4B3-4BFA-AF6E-98E58343C719@objectstyle-org%3e</id>
<updated>2009-12-04T16:08:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Yeah, I am using pretty much the same thing locally. Good idea t check  
whether embedded Jetty is usable as a web container. (I thought  
Eclipse uses it for something other than web apps execution?)

Andrus

On Dec 4, 2009, at 5:48 PM, Mike Kienenberger wrote:

&gt; For an Eclipse WebContainer, I use an external jetty install (although
&gt; I think Jetty 7 now ships with Eclipse), a jetty-xml config file, and
&gt; a file-based (Run Config -&gt; Common -&gt; Save as local file) run
&gt; configuration specifying the main class and any other configuration.
&gt; Turned out to be a lot easier than trying to keep up with
&gt; JettyLauncher, and gave me more options.   I can check both
&gt; configurations into the project, and by defining a jetty user library
&gt; (pointing to the jetty install libs), all of the other team members
&gt; can use it.   They grab the jetty version of their choice, add it to
&gt; to their user lib, and it all just works.
&gt;
&gt; For eclipse-based tutorials, this would all be straight-forward except
&gt; for the external jetty install, but if newer versions of eclipse ship
&gt; with jetty bundled, then that problem goes away.
&gt;
&gt; It's generally useful info, so I sanitized my config files and
&gt; attached them to the message as well as included them inline as text.
&gt;
&gt; =====================Jetty projectname.launch ====================
&gt;
&gt; &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&gt; &lt;launchConfiguration  
&gt; type="org.eclipse.jdt.launching.localJavaApplication"&gt;
&gt; &lt;stringAttribute key="bad_container_name"
&gt; value="jetty-run-configuration.eclipse"/&gt;
&gt; &lt;listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"&gt;
&gt; &lt;listEntry value="/projectName"/&gt;
&gt; &lt;/listAttribute&gt;
&gt; &lt;listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"&gt;
&gt; &lt;listEntry value="4"/&gt;
&gt; &lt;/listAttribute&gt;
&gt; &lt;stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
&gt; value="org.mortbay.start.Main"/&gt;
&gt; &lt;stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
&gt; value="jetty-projectName.xml"/&gt;
&gt; &lt;stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
&gt; value="projectName"/&gt;
&gt; &lt;stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
&gt; value="-XX:MaxPermSize=256m
&gt; -Djetty.keystore.home=${workspace_loc:projectName}
&gt; -Djetty.webappRootDir=${workspace_loc:projectName}"/&gt;
&gt; &lt;/launchConfiguration&gt;
&gt;
&gt; ===================== ^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
&gt; ====================
&gt;
&gt; =====================Jetty projectname.xml ====================
&gt;
&gt; &lt;?xml version="1.0"?&gt;
&gt; &lt;!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
&gt; "http://jetty.mortbay.org/configure.dtd"&gt;
&gt; &lt;Configure id="Server" class="org.mortbay.jetty.Server"&gt;
&gt;    &lt;Set name="ThreadPool"&gt;
&gt;      &lt;New class="org.mortbay.thread.BoundedThreadPool"&gt;
&gt;        &lt;Set name="minThreads"&gt;2&lt;/Set&gt;
&gt;        &lt;Set name="lowThreads"&gt;2&lt;/Set&gt;
&gt;        &lt;Set name="maxThreads"&gt;10&lt;/Set&gt;
&gt;      &lt;/New&gt;
&gt;    &lt;/Set&gt;
&gt;
&gt; 	&lt;Call name="addConnector"&gt;
&gt; 	    &lt;Arg&gt;
&gt; 	      &lt;New class="org.mortbay.jetty.security.SslSocketConnector"&gt;
&gt; 	        &lt;Set name="Port"&gt;4443&lt;/Set&gt;
&gt; 	        &lt;Set name="maxIdleTime"&gt;30000&lt;/Set&gt;
&gt; 	        &lt;Set name="keystore"&gt;&lt;SystemProperty
&gt; name="jetty.keystore.home" default="." /&gt;/keystore-jetty&lt;/Set&gt;
&gt; 	        &lt;Set name="password"&gt;password&lt;/Set&gt;
&gt; 	        &lt;Set name="keyPassword"&gt;keyPassword&lt;/Set&gt;
&gt; 	        &lt;Set name="truststore"&gt;&lt;SystemProperty
&gt; name="jetty.keystore.home" default="." /&gt;/keystore-jetty&lt;/Set&gt;
&gt; 	        &lt;Set name="trustPassword"&gt;trustPassword&lt;/Set&gt;
&gt; 	      &lt;/New&gt;
&gt; 	    &lt;/Arg&gt;
&gt; 	  &lt;/Call&gt;
&gt;
&gt;    &lt;Call name="addConnector"&gt;
&gt;      &lt;Arg&gt;
&gt;          &lt;New class="org.mortbay.jetty.bio.SocketConnector"&gt;
&gt;            &lt;Set name="port"&gt;&lt;SystemProperty name="jetty.port"
&gt; default="7777"/&gt;&lt;/Set&gt;
&gt;            &lt;Set name="maxIdleTime"&gt;30000&lt;/Set&gt;
&gt;            &lt;Set name="Acceptors"&gt;2&lt;/Set&gt;
&gt;            &lt;Set name="confidentialPort"&gt;4443&lt;/Set&gt;
&gt;          &lt;/New&gt;
&gt;      &lt;/Arg&gt;
&gt;    &lt;/Call&gt;
&gt;    &lt;Set name="handler"&gt;
&gt;      &lt;New id="handlers"  
&gt; class="org.mortbay.jetty.handler.HandlerCollection"&gt;
&gt;        &lt;Set name="handlers"&gt;
&gt;         &lt;Array type="org.mortbay.jetty.Handler"&gt;
&gt;           &lt;Item&gt;
&gt;             &lt;New id="contexts"
&gt; class="org.mortbay.jetty.handler.ContextHandlerCollection"/&gt;
&gt;           &lt;/Item&gt;
&gt;           &lt;Item&gt;
&gt;             &lt;New id="defaultHandler"
&gt; class="org.mortbay.jetty.handler.DefaultHandler"/&gt;
&gt;           &lt;/Item&gt;
&gt;           &lt;Item&gt;
&gt;             &lt;New id="requestLog"
&gt; class="org.mortbay.jetty.handler.RequestLogHandler"/&gt;
&gt;           &lt;/Item&gt;
&gt;         &lt;/Array&gt;
&gt;        &lt;/Set&gt;
&gt;      &lt;/New&gt;
&gt;    &lt;/Set&gt;
&gt;    &lt;New id="projectName"  
&gt; class="org.mortbay.jetty.webapp.WebAppContext"&gt;
&gt;      &lt;Arg&gt;&lt;Ref id="contexts"/&gt;&lt;/Arg&gt;
&gt;      &lt;Arg&gt;&lt;SystemProperty name="jetty.webappRootDir" default="." /&gt;&lt;/

&gt; Arg&gt;
&gt;      &lt;Arg&gt;/projectName&lt;/Arg&gt;
&gt;    &lt;/New&gt;
&gt;
&gt;    &lt;!-- ===========================================================  
&gt; --&gt;
&gt;    &lt;!-- extra options                                                
&gt; --&gt;
&gt;    &lt;!-- ===========================================================  
&gt; --&gt;
&gt;    &lt;Set name="stopAtShutdown"&gt;true&lt;/Set&gt;
&gt;    &lt;!-- ensure/prevent Server: header being sent to browsers         
&gt; --&gt;
&gt;    &lt;Set name="sendServerVersion"&gt;true&lt;/Set&gt;
&gt;
&gt; 	
&gt; &lt;!-- JNDI data source
&gt;
&gt;  &lt;Call name="addService"&gt;
&gt;    &lt;Arg&gt;
&gt;      &lt;New class="org.mortbay.jetty.plus.JotmService"&gt;
&gt;        &lt;Call name="addDataSource"&gt;
&gt;             &lt;Arg&gt;jdbc/db1&lt;/Arg&gt;
&gt;             &lt;Arg&gt;
&gt; 			   &lt;New class="org.apache.commons.dbcp.BasicDataSource"&gt;
&gt;                 &lt;Set  
&gt; name="DriverName"&gt;oracle.jdbc.driver.OracleDriver&lt;/Set&gt;
&gt;                 &lt;Set name="Url"&gt;jdbc:oracle:thin:@yourhost: 
&gt; 1521:yourdb&lt;/Set&gt;
&gt;                 &lt;Set name="User"&gt;db1&lt;/Set&gt;
&gt;                 &lt;Set name="Password"&gt;passwd&lt;/Set&gt;
&gt; 				&lt;/New&gt;
&gt;             &lt;/Arg&gt;
&gt;        &lt;/Call&gt;
&gt;     &lt;/New&gt;
&gt;   &lt;/Arg&gt;
&gt;  &lt;/Call&gt;
&gt;
&gt; --&gt;
&gt; 	
&gt; &lt;/Configure&gt;
&gt; ===================== ^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
&gt; ====================
&gt;
&gt;
&gt; On Fri, Dec 4, 2009 at 4:13 AM, Andrus Adamchik &lt;andrus@objectstyle.org 
&gt; &gt; wrote:
&gt;&gt; I think I am giving up on an idea of a Maven-free tutorial. It will  
&gt;&gt; be just
&gt;&gt; too hard for us to maintain... In return for introducing Maven to the
&gt;&gt; "Getting Started" tutorials we'll get a these benefits:
&gt;&gt;
&gt;&gt; * Maven-based web container start (I am at a loss which webapp  
&gt;&gt; Eclipse
&gt;&gt; plugin to recommend to users these days... They either suck or  
&gt;&gt; unsupported
&gt;&gt; and out of date... I am personally using a Jetty launcher with main  
&gt;&gt; class
&gt;&gt; that I wrote).
&gt;&gt;
&gt;&gt; * Declarative dependency management (instead of "download Derby  
&gt;&gt; from here",
&gt;&gt; we just tell them to place it in the pom).
&gt;&gt;
&gt;&gt; * Tutorials code can be built together with Cayenne core, so they  
&gt;&gt; never
&gt;&gt; become invalid (and there's a better chance they will be  
&gt;&gt; maintained), and
&gt;&gt; also can be easily bundled with a release.
&gt;&gt;
&gt;&gt;
&gt;&gt; The downsides are:
&gt;&gt;
&gt;&gt; * Some people just won't bother using Maven
&gt;&gt;
&gt;&gt; * Since dependency management is transparent, we don't show how to  
&gt;&gt; include
&gt;&gt; dependent jars in the project.
&gt;&gt;
&gt;&gt; I guess Maven wins...
&gt;&gt;
&gt;&gt; Andrus
&gt;&gt;
&gt; &lt;jetty-projectName.xml&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Tutorials</title>
<author><name>Mike Kienenberger &lt;mkienenb@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c8f985b960912040748t7736e770u714bb96f80404987@mail.gmail.com%3e"/>
<id>urn:uuid:%3c8f985b960912040748t7736e770u714bb96f80404987@mail-gmail-com%3e</id>
<updated>2009-12-04T15:48:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
For an Eclipse WebContainer, I use an external jetty install (although
I think Jetty 7 now ships with Eclipse), a jetty-xml config file, and
a file-based (Run Config -&gt; Common -&gt; Save as local file) run
configuration specifying the main class and any other configuration.
Turned out to be a lot easier than trying to keep up with
JettyLauncher, and gave me more options.   I can check both
configurations into the project, and by defining a jetty user library
(pointing to the jetty install libs), all of the other team members
can use it.   They grab the jetty version of their choice, add it to
to their user lib, and it all just works.

For eclipse-based tutorials, this would all be straight-forward except
for the external jetty install, but if newer versions of eclipse ship
with jetty bundled, then that problem goes away.

It's generally useful info, so I sanitized my config files and
attached them to the message as well as included them inline as text.

=====================Jetty projectname.launch ====================

&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"&gt;
&lt;stringAttribute key="bad_container_name"
value="jetty-run-configuration.eclipse"/&gt;
&lt;listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"&gt;
&lt;listEntry value="/projectName"/&gt;
&lt;/listAttribute&gt;
&lt;listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"&gt;
&lt;listEntry value="4"/&gt;
&lt;/listAttribute&gt;
&lt;stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.mortbay.start.Main"/&gt;
&lt;stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
value="jetty-projectName.xml"/&gt;
&lt;stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
value="projectName"/&gt;
&lt;stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
value="-XX:MaxPermSize=256m
-Djetty.keystore.home=${workspace_loc:projectName}
-Djetty.webappRootDir=${workspace_loc:projectName}"/&gt;
&lt;/launchConfiguration&gt;

===================== ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ====================

=====================Jetty projectname.xml ====================

&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd"&gt;
&lt;Configure id="Server" class="org.mortbay.jetty.Server"&gt;
    &lt;Set name="ThreadPool"&gt;
      &lt;New class="org.mortbay.thread.BoundedThreadPool"&gt;
        &lt;Set name="minThreads"&gt;2&lt;/Set&gt;
        &lt;Set name="lowThreads"&gt;2&lt;/Set&gt;
        &lt;Set name="maxThreads"&gt;10&lt;/Set&gt;
      &lt;/New&gt;
    &lt;/Set&gt;

	&lt;Call name="addConnector"&gt;
	    &lt;Arg&gt;
	      &lt;New class="org.mortbay.jetty.security.SslSocketConnector"&gt;
	        &lt;Set name="Port"&gt;4443&lt;/Set&gt;
	        &lt;Set name="maxIdleTime"&gt;30000&lt;/Set&gt;
	        &lt;Set name="keystore"&gt;&lt;SystemProperty
name="jetty.keystore.home" default="." /&gt;/keystore-jetty&lt;/Set&gt;
	        &lt;Set name="password"&gt;password&lt;/Set&gt;
	        &lt;Set name="keyPassword"&gt;keyPassword&lt;/Set&gt;
	        &lt;Set name="truststore"&gt;&lt;SystemProperty
name="jetty.keystore.home" default="." /&gt;/keystore-jetty&lt;/Set&gt;
	        &lt;Set name="trustPassword"&gt;trustPassword&lt;/Set&gt;
	      &lt;/New&gt;
	    &lt;/Arg&gt;
	  &lt;/Call&gt;

    &lt;Call name="addConnector"&gt;
      &lt;Arg&gt;
          &lt;New class="org.mortbay.jetty.bio.SocketConnector"&gt;
            &lt;Set name="port"&gt;&lt;SystemProperty name="jetty.port"
default="7777"/&gt;&lt;/Set&gt;
            &lt;Set name="maxIdleTime"&gt;30000&lt;/Set&gt;
            &lt;Set name="Acceptors"&gt;2&lt;/Set&gt;
            &lt;Set name="confidentialPort"&gt;4443&lt;/Set&gt;
          &lt;/New&gt;
      &lt;/Arg&gt;
    &lt;/Call&gt;
    &lt;Set name="handler"&gt;
      &lt;New id="handlers" class="org.mortbay.jetty.handler.HandlerCollection"&gt;
        &lt;Set name="handlers"&gt;
         &lt;Array type="org.mortbay.jetty.Handler"&gt;
           &lt;Item&gt;
             &lt;New id="contexts"
class="org.mortbay.jetty.handler.ContextHandlerCollection"/&gt;
           &lt;/Item&gt;
           &lt;Item&gt;
             &lt;New id="defaultHandler"
class="org.mortbay.jetty.handler.DefaultHandler"/&gt;
           &lt;/Item&gt;
           &lt;Item&gt;
             &lt;New id="requestLog"
class="org.mortbay.jetty.handler.RequestLogHandler"/&gt;
           &lt;/Item&gt;
         &lt;/Array&gt;
        &lt;/Set&gt;
      &lt;/New&gt;
    &lt;/Set&gt;
    &lt;New id="projectName" class="org.mortbay.jetty.webapp.WebAppContext"&gt;
      &lt;Arg&gt;&lt;Ref id="contexts"/&gt;&lt;/Arg&gt;
      &lt;Arg&gt;&lt;SystemProperty name="jetty.webappRootDir" default="." /&gt;&lt;/Arg&gt;
      &lt;Arg&gt;/projectName&lt;/Arg&gt;
    &lt;/New&gt;

    &lt;!-- =========================================================== --&gt;
    &lt;!-- extra options                                               --&gt;
    &lt;!-- =========================================================== --&gt;
    &lt;Set name="stopAtShutdown"&gt;true&lt;/Set&gt;
    &lt;!-- ensure/prevent Server: header being sent to browsers        --&gt;
    &lt;Set name="sendServerVersion"&gt;true&lt;/Set&gt;

	
&lt;!-- JNDI data source

  &lt;Call name="addService"&gt;
    &lt;Arg&gt;
      &lt;New class="org.mortbay.jetty.plus.JotmService"&gt;
        &lt;Call name="addDataSource"&gt;
             &lt;Arg&gt;jdbc/db1&lt;/Arg&gt;
             &lt;Arg&gt;
			   &lt;New class="org.apache.commons.dbcp.BasicDataSource"&gt;
                 &lt;Set name="DriverName"&gt;oracle.jdbc.driver.OracleDriver&lt;/Set&gt;
                 &lt;Set name="Url"&gt;jdbc:oracle:thin:@yourhost:1521:yourdb&lt;/Set&gt;
                 &lt;Set name="User"&gt;db1&lt;/Set&gt;
                 &lt;Set name="Password"&gt;passwd&lt;/Set&gt;
				&lt;/New&gt;
             &lt;/Arg&gt;
        &lt;/Call&gt;
     &lt;/New&gt;
   &lt;/Arg&gt;
  &lt;/Call&gt;

--&gt;
	
&lt;/Configure&gt;
===================== ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ====================


On Fri, Dec 4, 2009 at 4:13 AM, Andrus Adamchik &lt;andrus@objectstyle.org&gt; wrote:
&gt; I think I am giving up on an idea of a Maven-free tutorial. It will be just
&gt; too hard for us to maintain... In return for introducing Maven to the
&gt; "Getting Started" tutorials we'll get a these benefits:
&gt;
&gt; * Maven-based web container start (I am at a loss which webapp Eclipse
&gt; plugin to recommend to users these days... They either suck or unsupported
&gt; and out of date... I am personally using a Jetty launcher with main class
&gt; that I wrote).
&gt;
&gt; * Declarative dependency management (instead of "download Derby from here",
&gt; we just tell them to place it in the pom).
&gt;
&gt; * Tutorials code can be built together with Cayenne core, so they never
&gt; become invalid (and there's a better chance they will be maintained), and
&gt; also can be easily bundled with a release.
&gt;
&gt;
&gt; The downsides are:
&gt;
&gt; * Some people just won't bother using Maven
&gt;
&gt; * Since dependency management is transparent, we don't show how to include
&gt; dependent jars in the project.
&gt;
&gt; I guess Maven wins...
&gt;
&gt; Andrus
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Tutorials</title>
<author><name>=?koi8-r?B?8tHCycPLycog5dfHxc7Jyg==?= &lt;eryabitskiy@diasoft.ru&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3DEE6BDD7473324C8320C35F924F1DF904F77330@PALLADA.diasoft.ru%3e"/>
<id>urn:uuid:%3c3DEE6BDD7473324C8320C35F924F1DF904F77330@PALLADA-diasoft-ru%3e</id>
<updated>2009-12-04T10:47:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


&gt; * Tutorials code can be built together with Cayenne core, so they  
&gt; never become invalid (and there's a better chance they will be  
&gt; maintained), and also can be easily bundled with a release.

Some note from my experience.
Best way is to add tutorials build and any docs build as a profile in Maven (turned off by
default). And turn on this profile at Hudson. Also turn it while release. If someone changing
docs he should turn it.
But nobody else want to build docs every time.

Evgeny.


</pre>
</div>
</content>
</entry>
<entry>
<title>Tutorials</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c55B4F5B5-8DDB-42A9-92B4-481B3F373DC7@objectstyle.org%3e"/>
<id>urn:uuid:%3c55B4F5B5-8DDB-42A9-92B4-481B3F373DC7@objectstyle-org%3e</id>
<updated>2009-12-04T09:13:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I think I am giving up on an idea of a Maven-free tutorial. It will be  
just too hard for us to maintain... In return for introducing Maven to  
the "Getting Started" tutorials we'll get a these benefits:

* Maven-based web container start (I am at a loss which webapp Eclipse  
plugin to recommend to users these days... They either suck or  
unsupported and out of date... I am personally using a Jetty launcher  
with main class that I wrote).

* Declarative dependency management (instead of "download Derby from  
here", we just tell them to place it in the pom).

* Tutorials code can be built together with Cayenne core, so they  
never become invalid (and there's a better chance they will be  
maintained), and also can be easily bundled with a release.


The downsides are:

* Some people just won't bother using Maven

* Since dependency management is transparent, we don't show how to  
include dependent jars in the project.

I guess Maven wins...

Andrus


</pre>
</div>
</content>
</entry>
<entry>
<title>=?UTF-8?Q?Hudson_build_is_back_to_normal:_Cay?= =?UTF-8?Q?enne-trunk_=C2=BB_JDK_1.6_(latest),h2_#72?=</title>
<author><name>Apache Hudson Server &lt;hudson@hudson.zones.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c22849667.5961259870135993.JavaMail.hudson@hudson.zones.apache.org%3e"/>
<id>urn:uuid:%3c22849667-5961259870135993-JavaMail-hudson@hudson-zones-apache-org%3e</id>
<updated>2009-12-03T19:55:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
See &lt;http://hudson.zones.apache.org/hudson/job/Cayenne-trunk/./jdk=JDK%201.6%20(latest),testConnection=h2/72/changes&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>=?UTF-8?Q?Build_failed_in_Hudson:_Cayenne?= =?UTF-8?Q?-trunk_=C2=BB_JDK_1.6_(latest),h2_#71?=</title>
<author><name>Apache Hudson Server &lt;hudson@hudson.zones.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c8257457.5711259852797056.JavaMail.hudson@hudson.zones.apache.org%3e"/>
<id>urn:uuid:%3c8257457-5711259852797056-JavaMail-hudson@hudson-zones-apache-org%3e</id>
<updated>2009-12-03T15:06:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
See &lt;http://hudson.zones.apache.org/hudson/job/Cayenne-trunk/./jdk=JDK%201.6%20(latest),testConnection=h2/71/changes&gt;

Changes:

[oltka] * add note to RELEASE-NOTES adout CAY-1314

[andrey] CAY-762 ERDiagram for Object Entities in Cayenne Modeler. Show on Graph buttons for
entities

------------------------------------------
[...truncated 70623 lines...]
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1786, 2-&gt;ID_CLOB:265, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1787, 2-&gt;ID_CLOB:235, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1788, 2-&gt;ID_CLOB:279, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1789, 2-&gt;ID_CLOB:293, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1790, 2-&gt;ID_CLOB:296, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1791, 2-&gt;ID_CLOB:221, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1792, 2-&gt;ID_CLOB:253, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1793, 2-&gt;ID_CLOB:248, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1794, 2-&gt;ID_CLOB:222, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1795, 2-&gt;ID_CLOB:284, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1796, 2-&gt;ID_CLOB:244, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1797, 2-&gt;ID_CLOB:283, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1798, 2-&gt;ID_CLOB:287, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ID:1799, 2-&gt;ID_CLOB:257, 3-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: SELECT t0.CLOB_TEST_ID, t0.CLOB_COL FROM CLOB_TEST t0 JOIN CLOB_TEST_RELATION t1 ON
(t0.CLOB_TEST_ID = t1.ID_CLOB) WHERE t1.VALUE = ? [bind: 1-&gt;VALUE:100]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logSelectCount
INFO: === returned 25 rows. - took 6 ms.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.363 sec
Running org.apache.cayenne.access.DataContextQueryCachingTest
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 2 queries.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: insert into ARTIST (ARTIST_ID, ARTIST_NAME) values (33001, 'aaa')
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO PAINTING (PAINTING_ID, PAINTING_TITLE, ARTIST_ID, ESTIMATED_PRICE) VALUES
(33001, 'P', 33001, 4000)
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: SELECT t0.DATE_OF_BIRTH, t0.ARTIST_ID, t0.ARTIST_NAME FROM ARTIST t0
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logSelectCount
INFO: === returned 1 row. - took 0 ms.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: update ARTIST set ARTIST_NAME = 'bbb' where ARTIST_ID = 33001
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: SELECT t0.DATE_OF_BIRTH, t0.ARTIST_ID, t0.ARTIST_NAME FROM ARTIST t0
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logSelectCount
INFO: === returned 1 row. - took 1 ms.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
Running org.apache.cayenne.access.NestedDataContextParentPeerEventsTest
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME, DATE_OF_BIRTH) VALUES (?, ?, ?)
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:256, 2-&gt;ARTIST_NAME:'X', 3-&gt;DATE_OF_BIRTH:NULL]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: UPDATE ARTIST SET ARTIST_NAME = ? WHERE ARTIST_ID = ?
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_NAME:'Y', 2-&gt;ARTIST_ID:256]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 2 queries.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME, DATE_OF_BIRTH) VALUES (?, ?, ?)
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:257, 2-&gt;ARTIST_NAME:'X', 3-&gt;DATE_OF_BIRTH:NULL]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:258, 2-&gt;ARTIST_NAME:'Y', 3-&gt;DATE_OF_BIRTH:NULL]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO PAINTING (ARTIST_ID, ESTIMATED_PRICE, GALLERY_ID, PAINTING_DESCRIPTION,
PAINTING_ID, PAINTING_TITLE) VALUES (?, ?, ?, ?, ?, ?)
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:257, 2-&gt;ESTIMATED_PRICE:NULL, 3-&gt;GALLERY_ID:NULL, 4-&gt;PAINTING_DESCRIPTION:NULL,
5-&gt;PAINTING_ID:256, 6-&gt;PAINTING_TITLE:'PPP']
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: UPDATE PAINTING SET ARTIST_ID = ? WHERE PAINTING_ID = ?
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:258, 2-&gt;PAINTING_ID:256]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 2 queries.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME, DATE_OF_BIRTH) VALUES (?, ?, ?)
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:259, 2-&gt;ARTIST_NAME:'X', 3-&gt;DATE_OF_BIRTH:NULL]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO PAINTING (ARTIST_ID, ESTIMATED_PRICE, GALLERY_ID, PAINTING_DESCRIPTION,
PAINTING_ID, PAINTING_TITLE) VALUES (?, ?, ?, ?, ?, ?)
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:NULL, 2-&gt;ESTIMATED_PRICE:NULL, 3-&gt;GALLERY_ID:NULL, 4-&gt;PAINTING_DESCRIPTION:NULL,
5-&gt;PAINTING_ID:257, 6-&gt;PAINTING_TITLE:'PY']
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:259, 2-&gt;ESTIMATED_PRICE:NULL, 3-&gt;GALLERY_ID:NULL, 4-&gt;PAINTING_DESCRIPTION:NULL,
5-&gt;PAINTING_ID:258, 6-&gt;PAINTING_TITLE:'PX']
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: UPDATE PAINTING SET ARTIST_ID = ? WHERE PAINTING_ID = ?
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [bind: 1-&gt;ARTIST_ID:259, 2-&gt;PAINTING_ID:257]
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Dec 3, 2009 3:06:29 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Dec 3, 2009 3:06:30 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Dec 3, 2009 3:06:30 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Dec 3, 2009 3:06:30 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: SELECT t0.ARTIST_ID, t0.PAINTING_ID, t0.GALLERY_ID, t0.PAINTING_DESCRIPTION, t0.ESTIMATED_PRICE,
t0.PAINTING_TITLE FROM PAINTING t0 WHERE t0.ARTIST_ID = ? [bind: 1-&gt;ARTIST_ID:259]
Dec 3, 2009 3:06:30 PM org.apache.cayenne.access.QueryLogger logSelectCount
INFO: === returned 2 rows. - took 1 ms.
Dec 3, 2009 3:06:30 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.949 sec
Running org.apache.cayenne.DataRowTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
Running org.apache.cayenne.access.types.EnumTypeTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running org.apache.cayenne.access.CustomQueryTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Running org.apache.cayenne.project.validator.DomainValidatorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec

Results :

Failed tests: 
  testBlockShouldProcessDeleteOnExternalChange(org.apache.cayenne.access.DataContextDelegateSharedCacheTest)

Tests run: 2052, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to /zonestorage/hudson/home/hudson/hudson/jobs/Cayenne-trunk/workspace/jdk/JDK
1.6 (latest)/testConnection/h2/trunk/framework/cayenne-jdk1.5-unpublished/target/surefire-reports
for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 32 seconds
[INFO] Finished at: Thu Dec 03 15:06:31 UTC 2009
[INFO] Final Memory: 53M/188M
[INFO] ------------------------------------------------------------------------



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in  Cayenne Modeler</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c518701EA-3DBE-43CF-91D3-9F8A5E6E3EF4@objectstyle.org%3e"/>
<id>urn:uuid:%3c518701EA-3DBE-43CF-91D3-9F8A5E6E3EF4@objectstyle-org%3e</id>
<updated>2009-12-03T14:38:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Dec 3, 2009, at 4:22 PM, Mike Kienenberger wrote:

&gt;  It doesn't make any sense to have a project-specific piece of  
&gt; information
&gt; stored in preferences.

And still we do that a lot already. There's a bunch of per-screen  
Modeler preferences stored per project (and not in user visible XML  
files). If you move to another machine, you lose it.

I think the difference here is in a mental view of the graph layout  
task. To you and Andrey it is a part of the ORM modeling work. To me  
it is not. It is a *local* user preference. Something a single  
developer would tweak to his or her liking, kind of like arranging  
icons on a desktop.

Let me give you a few examples of why sharing a layout might be bad:

* 2 developers on the project want to have different layouts, because  
they work with different parts of the model. So they group entities  
differently.

* A single developer rearranges the layout multiple times during the  
day as he goes from one task to another.

* 1 developer uses a 13" notebook, another - 31" screen. Developer 1  
has no choice, but to optimize the layout for his screen.

Andrus



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in	Cayenne Modeler</title>
<author><name>Andrey Razumovsky &lt;razumovsky.andrey@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3219fff70912030630w3ed4e231w7343f11f654efdf0@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3219fff70912030630w3ed4e231w7343f11f654efdf0@mail-gmail-com%3e</id>
<updated>2009-12-03T14:30:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
We can have some check box "save graph changes" for every graph. by default
it is false, and turns on if there were major changes (e.g. entity added) or
checked manually. Minor changes (entity moved, resized, etc) will not be
saved by default.
Anyways, I think this task is not of highest priority, and we need more
opinions to take decision

2009/12/3 Mike Kienenberger &lt;mkienenb@gmail.com&gt;

&gt; I agree with Andrey.   It should be saved as part of the project.  It
&gt; doesn't make any sense to have a project-specific piece of information
&gt; stored in preferences.  If you copy your project to another machine,
&gt; you lose the information.  If you delete the project, the information
&gt; remains in preferences even though the project is gone.
&gt;
&gt; You should mark it as ignored if you don't want to put it in your SCM
&gt; or if the noise bothers you.
&gt;
&gt;
&gt; On Thu, Dec 3, 2009 at 9:03 AM, Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt; wrote:
&gt; &gt; I agree with the premise, but I had bad experience with other ORM tools
&gt; &gt; years ago that would save the layout together with the project, and then
&gt; a
&gt; &gt; single unintended mouse move results in making the project "dirty" and
&gt; &gt; creates an underlying SCM change. IMO that was a distraction and created
&gt; &gt; constant commit noise.
&gt; &gt;
&gt; &gt; So essentially managing a pretty layout is a parallel task to the main
&gt; task
&gt; &gt; of creating a model, and I don't want it to become a distraction. So
&gt; maybe
&gt; &gt; we can make it a project property (persist-layout: true|false (default))?
&gt; If
&gt; &gt; true, it will store the XML together with the project, if false, it will
&gt; &gt; store it in local preferences?
&gt; &gt;
&gt; &gt; Andrus
&gt; &gt;
&gt; &gt;
&gt; &gt; On Dec 3, 2009, at 3:47 PM, Andrey Razumovsky wrote:
&gt; &gt;&gt;
&gt; &gt;&gt; 2009/12/3 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt; &gt;&gt;
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; On Dec 3, 2009, at 3:31 PM, Andrus Adamchik wrote:
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; * saving graphs info as &lt;domain_name&gt;.graph.xml (and restoring). Note
&gt; &gt;&gt;&gt; that
&gt; &gt;&gt;&gt;&gt;&gt;
&gt; &gt;&gt;&gt;&gt;&gt; this file will not be used in classic Cayenne runtime
&gt; &gt;&gt;&gt;&gt;&gt;
&gt; &gt;&gt;&gt;&gt;
&gt; &gt;&gt;&gt; I think this can be tied to preferences and saved in ~/.cayenne/.
&gt; Saving
&gt; &gt;&gt;&gt; it
&gt; &gt;&gt;&gt; in the project tree has SCM implications.
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt;
&gt; &gt;&gt; I thought of that..
&gt; &gt;&gt; Lets take your example. You've got an enormous project, so no layout can
&gt; &gt;&gt; place entities without intersections. You spend half a day to organize
&gt; it
&gt; &gt;&gt; well.. Then what? How can other members of the team see your changes? It
&gt; &gt;&gt; is
&gt; &gt;&gt; even better when graph is in SCM - it is not a big file, and allows
&gt; &gt;&gt; everyone
&gt; &gt;&gt; to see it. Graph file is XML, so SVN should merge it correctly. The only
&gt; &gt;&gt; thing you need is exclude it from packaged version of your project (if
&gt; you
&gt; &gt;&gt; want).
&gt; &gt;&gt;
&gt; &gt;&gt; At last resort you can add graph files to something like svn:ignore
&gt; &gt;
&gt; &gt;
&gt;



-- 
Andrey


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in	Cayenne Modeler</title>
<author><name>Mike Kienenberger &lt;mkienenb@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c8f985b960912030622y51aa6332m94ca42d1c62f4df0@mail.gmail.com%3e"/>
<id>urn:uuid:%3c8f985b960912030622y51aa6332m94ca42d1c62f4df0@mail-gmail-com%3e</id>
<updated>2009-12-03T14:22:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I agree with Andrey.   It should be saved as part of the project.  It
doesn't make any sense to have a project-specific piece of information
stored in preferences.  If you copy your project to another machine,
you lose the information.  If you delete the project, the information
remains in preferences even though the project is gone.

You should mark it as ignored if you don't want to put it in your SCM
or if the noise bothers you.


On Thu, Dec 3, 2009 at 9:03 AM, Andrus Adamchik &lt;andrus@objectstyle.org&gt; wrote:
&gt; I agree with the premise, but I had bad experience with other ORM tools
&gt; years ago that would save the layout together with the project, and then a
&gt; single unintended mouse move results in making the project "dirty" and
&gt; creates an underlying SCM change. IMO that was a distraction and created
&gt; constant commit noise.
&gt;
&gt; So essentially managing a pretty layout is a parallel task to the main task
&gt; of creating a model, and I don't want it to become a distraction. So maybe
&gt; we can make it a project property (persist-layout: true|false (default))? If
&gt; true, it will store the XML together with the project, if false, it will
&gt; store it in local preferences?
&gt;
&gt; Andrus
&gt;
&gt;
&gt; On Dec 3, 2009, at 3:47 PM, Andrey Razumovsky wrote:
&gt;&gt;
&gt;&gt; 2009/12/3 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; On Dec 3, 2009, at 3:31 PM, Andrus Adamchik wrote:
&gt;&gt;&gt;
&gt;&gt;&gt; * saving graphs info as &lt;domain_name&gt;.graph.xml (and restoring). Note
&gt;&gt;&gt; that
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; this file will not be used in classic Cayenne runtime
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt; I think this can be tied to preferences and saved in ~/.cayenne/. Saving
&gt;&gt;&gt; it
&gt;&gt;&gt; in the project tree has SCM implications.
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt; I thought of that..
&gt;&gt; Lets take your example. You've got an enormous project, so no layout can
&gt;&gt; place entities without intersections. You spend half a day to organize it
&gt;&gt; well.. Then what? How can other members of the team see your changes? It
&gt;&gt; is
&gt;&gt; even better when graph is in SCM - it is not a big file, and allows
&gt;&gt; everyone
&gt;&gt; to see it. Graph file is XML, so SVN should merge it correctly. The only
&gt;&gt; thing you need is exclude it from packaged version of your project (if you
&gt;&gt; want).
&gt;&gt;
&gt;&gt; At last resort you can add graph files to something like svn:ignore
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in  Cayenne Modeler</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3cE86611C9-8595-4975-A4A5-8521BFA8AA37@objectstyle.org%3e"/>
<id>urn:uuid:%3cE86611C9-8595-4975-A4A5-8521BFA8AA37@objectstyle-org%3e</id>
<updated>2009-12-03T14:03:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I agree with the premise, but I had bad experience with other ORM  
tools years ago that would save the layout together with the project,  
and then a single unintended mouse move results in making the project  
"dirty" and creates an underlying SCM change. IMO that was a  
distraction and created constant commit noise.

So essentially managing a pretty layout is a parallel task to the main  
task of creating a model, and I don't want it to become a distraction.  
So maybe we can make it a project property (persist-layout: true|false  
(default))? If true, it will store the XML together with the project,  
if false, it will store it in local preferences?

Andrus


On Dec 3, 2009, at 3:47 PM, Andrey Razumovsky wrote:
&gt; 2009/12/3 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt;
&gt;&gt;
&gt;&gt; On Dec 3, 2009, at 3:31 PM, Andrus Adamchik wrote:
&gt;&gt;
&gt;&gt; * saving graphs info as &lt;domain_name&gt;.graph.xml (and restoring).  
&gt;&gt; Note that
&gt;&gt;&gt;&gt; this file will not be used in classic Cayenne runtime
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt; I think this can be tied to preferences and saved in ~/.cayenne/.  
&gt;&gt; Saving it
&gt;&gt; in the project tree has SCM implications.
&gt;&gt;
&gt;&gt;
&gt; I thought of that..
&gt; Lets take your example. You've got an enormous project, so no layout  
&gt; can
&gt; place entities without intersections. You spend half a day to  
&gt; organize it
&gt; well.. Then what? How can other members of the team see your  
&gt; changes? It is
&gt; even better when graph is in SCM - it is not a big file, and allows  
&gt; everyone
&gt; to see it. Graph file is XML, so SVN should merge it correctly. The  
&gt; only
&gt; thing you need is exclude it from packaged version of your project  
&gt; (if you
&gt; want).
&gt;
&gt; At last resort you can add graph files to something like svn:ignore



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in	Cayenne Modeler</title>
<author><name>Andrey Razumovsky &lt;razumovsky.andrey@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3219fff70912030549l1d5e27a0k140bbd9e1de76256@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3219fff70912030549l1d5e27a0k140bbd9e1de76256@mail-gmail-com%3e</id>
<updated>2009-12-03T13:49:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The ultimate goal is to add most model operations (add/remove/edit
entity/attribute/relationship...) to graph panel. Then everything takes its
place and you can edit model and organize graph at the same time

2009/12/3 Andrus Adamchik &lt;andrus@objectstyle.org&gt;

&gt;
&gt; On Dec 3, 2009, at 3:39 PM, Andrey Razumovsky wrote:
&gt;
&gt;  if you create projects from the start, you can constanlly
&gt;&gt; and sequentially organize the graph
&gt;&gt;
&gt;
&gt; Good point.
&gt;
&gt;


-- 
Andrey


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in	Cayenne Modeler</title>
<author><name>Andrey Razumovsky &lt;razumovsky.andrey@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3219fff70912030547s44f8e058i1e74a4d800c9ab53@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3219fff70912030547s44f8e058i1e74a4d800c9ab53@mail-gmail-com%3e</id>
<updated>2009-12-03T13:47:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
2009/12/3 Andrus Adamchik &lt;andrus@objectstyle.org&gt;

&gt;
&gt; On Dec 3, 2009, at 3:31 PM, Andrus Adamchik wrote:
&gt;
&gt;  * saving graphs info as &lt;domain_name&gt;.graph.xml (and restoring). Note that
&gt;&gt;&gt; this file will not be used in classic Cayenne runtime
&gt;&gt;&gt;
&gt;&gt;
&gt; I think this can be tied to preferences and saved in ~/.cayenne/. Saving it
&gt; in the project tree has SCM implications.
&gt;
&gt;
I thought of that..
Lets take your example. You've got an enormous project, so no layout can
place entities without intersections. You spend half a day to organize it
well.. Then what? How can other members of the team see your changes? It is
even better when graph is in SCM - it is not a big file, and allows everyone
to see it. Graph file is XML, so SVN should merge it correctly. The only
thing you need is exclude it from packaged version of your project (if you
want).

At last resort you can add graph files to something like svn:ignore


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in  Cayenne Modeler</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3cB484FC22-AA39-44C6-BC82-BEDDB487807A@objectstyle.org%3e"/>
<id>urn:uuid:%3cB484FC22-AA39-44C6-BC82-BEDDB487807A@objectstyle-org%3e</id>
<updated>2009-12-03T13:42:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Dec 3, 2009, at 3:39 PM, Andrey Razumovsky wrote:

&gt; if you create projects from the start, you can constanlly
&gt; and sequentially organize the graph

Good point.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in Cayenne Modeler</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c799A1532-DB3D-472E-B9D9-45077C88AD0E@objectstyle.org%3e"/>
<id>urn:uuid:%3c799A1532-DB3D-472E-B9D9-45077C88AD0E@objectstyle-org%3e</id>
<updated>2009-12-03T13:40:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Dec 3, 2009, at 3:31 PM, Andrus Adamchik wrote:

&gt;&gt; * saving graphs info as &lt;domain_name&gt;.graph.xml (and restoring).  
&gt;&gt; Note that this file will not be used in classic Cayenne runtime

I think this can be tied to preferences and saved in ~/.cayenne/.  
Saving it in the project tree has SCM implications.

&gt;&gt; * grouping by datamaps (in fact, I've found that standard JGraph  
&gt;&gt; grouping doesn't look well on my models).

This (an maybe an ability to filter/group entities by some criteria)  
may be the answer to working with large schemas.

Andrus


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in	Cayenne Modeler</title>
<author><name>Andrey Razumovsky &lt;razumovsky.andrey@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3219fff70912030539h4577077ey6b925d362827ab31@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3219fff70912030539h4577077ey6b925d362827ab31@mail-gmail-com%3e</id>
<updated>2009-12-03T13:39:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Well, I played with standard JGraph layouts for some time, this is the best
I found. Probably I will return to this research someday. But definitely we
can create big graphs on bigger sheet, then it well be less confusing.
On the other hand, if you create projects from the start, you can constanlly
and sequentially organize the graph, so it will not be so messy.

2009/12/3 Andrus Adamchik &lt;andrus@objectstyle.org&gt;

&gt; Nice start!
&gt;
&gt; I wonder what we can do to scale it to large projects? E.g.:
&gt;
&gt;  http://people.apache.org/~aadamchik/class.png&lt;http://people.apache.org/%7Eaadamchik/class.png&gt;
&gt;
&gt; Coincidentally the same issue was discussed on a WebObjects mailing list
&gt; today. It is not yet archived, and if I don't forget, I'll forward the links
&gt; once it is archived.
&gt;
&gt; Andrus
&gt;
&gt;
&gt;
&gt; On Dec 2, 2009, at 4:50 PM, Andrey Razumovsky (JIRA) wrote:
&gt;
&gt;
&gt;&gt;   [
&gt;&gt; https://issues.apache.org/jira/browse/CAY-762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784856#action_12784856
&gt;&gt; ]
&gt;&gt;
&gt;&gt; Andrey Razumovsky commented on CAY-762:
&gt;&gt; ---------------------------------------
&gt;&gt;
&gt;&gt; First version is committed on 3.1 trunk and I welcome everyone to try it.
&gt;&gt; JGraph 5.13.0.0 is used as graph implementation.
&gt;&gt;
&gt;&gt; There are two types of diagrams - ER (for DbEntities) and Class (for
&gt;&gt; ObjEntities). They are avaliable through "Graph" tab of DataDomain
&gt;&gt; information panel.
&gt;&gt;
&gt;&gt; What IS done:
&gt;&gt; * drawing of entities with attributes and relationships between them,
&gt;&gt; showing arity of rels, inheritance
&gt;&gt; * quick showing entities in left-hand tree (using right-click context
&gt;&gt; menu), as well as some basic operation shortcuts
&gt;&gt; * lazy loading of graphs - they are not created until requested
&gt;&gt; * layout of firstly opened graph with entities (played a bit with jgraph
&gt;&gt; layouts, still not sure this is the best one). Note that opening a large
&gt;&gt; project may result in a complex web of entities
&gt;&gt; * saving graphs info as &lt;domain_name&gt;.graph.xml (and restoring). Note that
&gt;&gt; this file will not be used in classic Cayenne runtime
&gt;&gt; * synchronizing in both sides with left-hand tree
&gt;&gt; * scaling
&gt;&gt; * saving models as images
&gt;&gt; * undo support
&gt;&gt;
&gt;&gt; What IS NOT done:
&gt;&gt; * editing objects (e.g. entity names, attrs) in graph
&gt;&gt; * finding object on the graph from its info panel
&gt;&gt; * grouping by datamaps (in fact, I've found that standard JGraph grouping
&gt;&gt; doesn't look well on my models).
&gt;&gt;
&gt;&gt; Please post your comments
&gt;&gt;
&gt;&gt;  ERDiagram for Object Entities in Cayenne Modeler
&gt;&gt;&gt; ------------------------------------------------
&gt;&gt;&gt;
&gt;&gt;&gt;               Key: CAY-762
&gt;&gt;&gt;               URL: https://issues.apache.org/jira/browse/CAY-762
&gt;&gt;&gt;           Project: Cayenne
&gt;&gt;&gt;        Issue Type: New Feature
&gt;&gt;&gt;        Components: CayenneModeler GUI
&gt;&gt;&gt;  Affects Versions: 3.0
&gt;&gt;&gt;          Reporter: Ahmed Mohombe
&gt;&gt;&gt;          Assignee: Andrey Razumovsky
&gt;&gt;&gt;           Fix For: 3.1M1
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Please add an ER Diagram to the Cayenne Modeler. This is the feature that
&gt;&gt;&gt; I miss the most from WebObjects.
&gt;&gt;&gt; For start it would be even enough to have  an ER Diagram View (so no
&gt;&gt;&gt; interactive activities) - just display and layout of entities.
&gt;&gt;&gt; I think this would help allot and would increase the productivity with CM
&gt;&gt;&gt; - most people think visually.
&gt;&gt;&gt; I don't think that it would be complicated to implement, the most
&gt;&gt;&gt; complicated question to answer is what graph library is allowed to use, due
&gt;&gt;&gt; to the restrictive "license compatibility" of the Apache license.
&gt;&gt;&gt; Thanks in advance,
&gt;&gt;&gt; Ahmed.
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; --
&gt;&gt; This message is automatically generated by JIRA.
&gt;&gt; -
&gt;&gt; You can reply to this email to add a comment to the issue online.
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;


-- 
Andrey


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-762) ERDiagram for Object Entities in Cayenne Modeler</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c23BD8E48-DFE6-4766-83CC-CE2C90289120@objectstyle.org%3e"/>
<id>urn:uuid:%3c23BD8E48-DFE6-4766-83CC-CE2C90289120@objectstyle-org%3e</id>
<updated>2009-12-03T13:31:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Nice start!

I wonder what we can do to scale it to large projects? E.g.:

   http://people.apache.org/~aadamchik/class.png

Coincidentally the same issue was discussed on a WebObjects mailing  
list today. It is not yet archived, and if I don't forget, I'll  
forward the links once it is archived.

Andrus


On Dec 2, 2009, at 4:50 PM, Andrey Razumovsky (JIRA) wrote:

&gt;
&gt;    [ https://issues.apache.org/jira/browse/CAY-762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784856

&gt; #action_12784856 ]
&gt;
&gt; Andrey Razumovsky commented on CAY-762:
&gt; ---------------------------------------
&gt;
&gt; First version is committed on 3.1 trunk and I welcome everyone to  
&gt; try it.
&gt; JGraph 5.13.0.0 is used as graph implementation.
&gt;
&gt; There are two types of diagrams - ER (for DbEntities) and Class (for  
&gt; ObjEntities). They are avaliable through "Graph" tab of DataDomain  
&gt; information panel.
&gt;
&gt; What IS done:
&gt; * drawing of entities with attributes and relationships between  
&gt; them, showing arity of rels, inheritance
&gt; * quick showing entities in left-hand tree (using right-click  
&gt; context menu), as well as some basic operation shortcuts
&gt; * lazy loading of graphs - they are not created until requested
&gt; * layout of firstly opened graph with entities (played a bit with  
&gt; jgraph layouts, still not sure this is the best one). Note that  
&gt; opening a large project may result in a complex web of entities
&gt; * saving graphs info as &lt;domain_name&gt;.graph.xml (and restoring).  
&gt; Note that this file will not be used in classic Cayenne runtime
&gt; * synchronizing in both sides with left-hand tree
&gt; * scaling
&gt; * saving models as images
&gt; * undo support
&gt;
&gt; What IS NOT done:
&gt; * editing objects (e.g. entity names, attrs) in graph
&gt; * finding object on the graph from its info panel
&gt; * grouping by datamaps (in fact, I've found that standard JGraph  
&gt; grouping doesn't look well on my models).
&gt;
&gt; Please post your comments
&gt;
&gt;&gt; ERDiagram for Object Entities in Cayenne Modeler
&gt;&gt; ------------------------------------------------
&gt;&gt;
&gt;&gt;                Key: CAY-762
&gt;&gt;                URL: https://issues.apache.org/jira/browse/CAY-762
&gt;&gt;            Project: Cayenne
&gt;&gt;         Issue Type: New Feature
&gt;&gt;         Components: CayenneModeler GUI
&gt;&gt;   Affects Versions: 3.0
&gt;&gt;           Reporter: Ahmed Mohombe
&gt;&gt;           Assignee: Andrey Razumovsky
&gt;&gt;            Fix For: 3.1M1
&gt;&gt;
&gt;&gt;
&gt;&gt; Please add an ER Diagram to the Cayenne Modeler. This is the  
&gt;&gt; feature that I miss the most from WebObjects.
&gt;&gt; For start it would be even enough to have  an ER Diagram View (so  
&gt;&gt; no interactive activities) - just display and layout of entities.
&gt;&gt; I think this would help allot and would increase the productivity  
&gt;&gt; with CM - most people think visually.
&gt;&gt; I don't think that it would be complicated to implement, the most  
&gt;&gt; complicated question to answer is what graph library is allowed to  
&gt;&gt; use, due to the restrictive "license compatibility" of the Apache  
&gt;&gt; license.
&gt;&gt; Thanks in advance,
&gt;&gt; Ahmed.
&gt;
&gt; -- 
&gt; This message is automatically generated by JIRA.
&gt; -
&gt; You can reply to this email to add a comment to the issue online.
&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Cayenne Oracle tests</title>
<author><name>=?koi8-r?B?8tHCycPLycog5dfHxc7Jyg==?= &lt;eryabitskiy@diasoft.ru&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3DEE6BDD7473324C8320C35F924F1DF904F24C7C@PALLADA.diasoft.ru%3e"/>
<id>urn:uuid:%3c3DEE6BDD7473324C8320C35F924F1DF904F24C7C@PALLADA-diasoft-ru%3e</id>
<updated>2009-12-03T12:46:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Yeah... so much to do...

BTW I patially fixed that bug with oracle TIMESTAMP mapping. Think it will be fixed this weak.
Was idea to add JUnit, so I will try AccessStackAdapter.

Evgeny.

-----Original Message-----
From: Andrus Adamchik [mailto:andrus@objectstyle.org] 
Sent: Thursday, December 03, 2009 3:39 PM
To: dev@cayenne.apache.org
Subject: Re: Cayenne Oracle tests

We don't have per-DB tests. There's some weak support for excluding  
certain tests on some DB's (see  
org.apache.cayenne.unit.AccessStackAdapter).

Olga recently did the research of an implementation of per-DB test  
capabilities. This hasn't been discussed yet in detail, but this is  
something that I'd like to have in 3.1... Specifically this would  
require migration of the tests to TestNG, and organizing the tests  
into "test groups". Each target database can be associated with one or  
more test groups. So DB-specific stuff can be placed in a DB-specific  
group.

For now AccessStackAdapter and subclasses are the only way to achieve  
that.

Andrus


On Dec 3, 2009, at 1:53 PM, òÑÂÉÃËÉÊ å×ÇÅÎÉÊ wrote:

&gt; Yeah. Thx...
&gt; But what if I want to add some Oracle-specific test?
&gt; Do we have some?
&gt;
&gt; Evgeny.
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; -----Original Message-----
&gt; From: Aristedes Maniatis [mailto:ari@maniatis.org]
&gt; Sent: Thursday, December 03, 2009 1:44 PM
&gt; To: dev@cayenne.apache.org
&gt; Subject: Re: Cayenne Oracle tests
&gt;
&gt; On 3/12/09 8:50 PM, òÑÂÉÃËÉÊ å×ÇÅÎÉÊ wrote:
&gt;&gt; Hello!
&gt;&gt;
&gt;&gt; Can some one explain me how Cayenne is tested over Oracle.
&gt;&gt; Just going to add some Oracle-specific JUnit test. How to do it?
&gt;&gt; Any example... notes... documentation?
&gt;&gt;
&gt;&gt; Evgeny.
&gt;
&gt; If you want to run the unit tests... http://cayenne.apache.org/running-unit-tests.html
&gt;
&gt;
&gt; Ari
&gt;
&gt;
&gt; --------------------------&gt;
&gt; Aristedes Maniatis
&gt; GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Cayenne Oracle tests</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3cD78D7727-CB41-4052-8A1B-F669EA7B402C@objectstyle.org%3e"/>
<id>urn:uuid:%3cD78D7727-CB41-4052-8A1B-F669EA7B402C@objectstyle-org%3e</id>
<updated>2009-12-03T12:38:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
We don't have per-DB tests. There's some weak support for excluding  
certain tests on some DB's (see  
org.apache.cayenne.unit.AccessStackAdapter).

Olga recently did the research of an implementation of per-DB test  
capabilities. This hasn't been discussed yet in detail, but this is  
something that I'd like to have in 3.1... Specifically this would  
require migration of the tests to TestNG, and organizing the tests  
into "test groups". Each target database can be associated with one or  
more test groups. So DB-specific stuff can be placed in a DB-specific  
group.

For now AccessStackAdapter and subclasses are the only way to achieve  
that.

Andrus


On Dec 3, 2009, at 1:53 PM, òÑÂÉÃËÉÊ å×ÇÅÎÉÊ wrote:

&gt; Yeah. Thx...
&gt; But what if I want to add some Oracle-specific test?
&gt; Do we have some?
&gt;
&gt; Evgeny.
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; -----Original Message-----
&gt; From: Aristedes Maniatis [mailto:ari@maniatis.org]
&gt; Sent: Thursday, December 03, 2009 1:44 PM
&gt; To: dev@cayenne.apache.org
&gt; Subject: Re: Cayenne Oracle tests
&gt;
&gt; On 3/12/09 8:50 PM, òÑÂÉÃËÉÊ å×ÇÅÎÉÊ wrote:
&gt;&gt; Hello!
&gt;&gt;
&gt;&gt; Can some one explain me how Cayenne is tested over Oracle.
&gt;&gt; Just going to add some Oracle-specific JUnit test. How to do it?
&gt;&gt; Any example... notes... documentation?
&gt;&gt;
&gt;&gt; Evgeny.
&gt;
&gt; If you want to run the unit tests... http://cayenne.apache.org/running-unit-tests.html
&gt;
&gt;
&gt; Ari
&gt;
&gt;
&gt; --------------------------&gt;
&gt; Aristedes Maniatis
&gt; GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Cayenne Oracle tests</title>
<author><name>=?koi8-r?B?8tHCycPLycog5dfHxc7Jyg==?= &lt;eryabitskiy@diasoft.ru&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3DEE6BDD7473324C8320C35F924F1DF904F24B7E@PALLADA.diasoft.ru%3e"/>
<id>urn:uuid:%3c3DEE6BDD7473324C8320C35F924F1DF904F24B7E@PALLADA-diasoft-ru%3e</id>
<updated>2009-12-03T11:53:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Yeah. Thx...
But what if I want to add some Oracle-specific test?
Do we have some?

Evgeny.


 



-----Original Message-----
From: Aristedes Maniatis [mailto:ari@maniatis.org] 
Sent: Thursday, December 03, 2009 1:44 PM
To: dev@cayenne.apache.org
Subject: Re: Cayenne Oracle tests

On 3/12/09 8:50 PM, òÑÂÉÃËÉÊ å×ÇÅÎÉÊ wrote:
&gt; Hello!
&gt;
&gt; Can some one explain me how Cayenne is tested over Oracle.
&gt; Just going to add some Oracle-specific JUnit test. How to do it?
&gt; Any example... notes... documentation?
&gt;
&gt; Evgeny.

If you want to run the unit tests... http://cayenne.apache.org/running-unit-tests.html


Ari


--------------------------&gt;
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Cayenne Oracle tests</title>
<author><name>Aristedes Maniatis &lt;ari@maniatis.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c4B179661.9000907@maniatis.org%3e"/>
<id>urn:uuid:%3c4B179661-9000907@maniatis-org%3e</id>
<updated>2009-12-03T10:43:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On 3/12/09 8:50 PM, òÑÂÉÃËÉÊ å×ÇÅÎÉÊ wrote:
&gt; Hello!
&gt;
&gt; Can some one explain me how Cayenne is tested over Oracle.
&gt; Just going to add some Oracle-specific JUnit test. How to do it?
&gt; Any example... notes... documentation?
&gt;
&gt; Evgeny.

If you want to run the unit tests... http://cayenne.apache.org/running-unit-tests.html


Ari


--------------------------&gt;
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A


</pre>
</div>
</content>
</entry>
<entry>
<title>Cayenne Oracle tests</title>
<author><name>=?koi8-r?B?8tHCycPLycog5dfHxc7Jyg==?= &lt;eryabitskiy@diasoft.ru&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3DEE6BDD7473324C8320C35F924F1DF904F248EA@PALLADA.diasoft.ru%3e"/>
<id>urn:uuid:%3c3DEE6BDD7473324C8320C35F924F1DF904F248EA@PALLADA-diasoft-ru%3e</id>
<updated>2009-12-03T09:50:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello!

Can some one explain me how Cayenne is tested over Oracle.
Just going to add some Oracle-specific JUnit test. How to do it?
Any example... notes... documentation? 

Evgeny.







On Dec 2, 2009, at 6:16 PM, Evgeny Ryabitskiy (JIRA) wrote:
&gt;    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784887

&gt; #action_12784887 ]
&gt;
&gt; Evgeny Ryabitskiy commented on CAY-1323:
&gt; ----------------------------------------
&gt;
&gt; I think I finished my Investigation. If you wish I can add some  
&gt; JUnit for this UC.
&gt;
&gt; You can add "Fix Version" as you wish. But I think it should be  
&gt; fixed in all branches (1.0, 2.0, 3.0).
&gt; It is no expectable behavior.... As you wrote: "Cayenne Mapping can  
&gt; only contain JDBC types"
&gt;
&gt; How to fix... mm have thoughts that OracleAdapter can help us...  
&gt; need some time to look there inside
&gt;
&gt;&gt; oracle.sql.TIMESTAMP in Result of query
&gt;&gt; ---------------------------------------
&gt;&gt;
&gt;&gt;                Key: CAY-1323
&gt;&gt;                URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;&gt;            Project: Cayenne
&gt;&gt;         Issue Type: Bug
&gt;&gt;         Components: Cayenne Core Library
&gt;&gt;   Affects Versions: 2.0.5, 3.0 beta 1
&gt;&gt;           Reporter: Evgeny Ryabitskiy
&gt;&gt;           Assignee: Andrus Adamchik
&gt;&gt;        Attachments: cayenne.xml, OracleTimestampTest.java,  
&gt;&gt; OracleTimestampTestMap.map.xml
&gt;&gt;
&gt;&gt;
&gt;&gt; Result of query from column of timestamp type was mapped to  
&gt;&gt; oracle.sql.TIMESTAMP.
&gt;&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt;&gt; I am using latest official Oracle JDBC driver.
&gt;
&gt; -- 
&gt; This message is automatically generated by JIRA.
&gt; -
&gt; You can reply to this email to add a comment to the issue online.
&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of	query</title>
<author><name>Evgeny Ryabitskiy &lt;evgeny.ryabitskiy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c9f90c2b60912020925x20b23582m891627bc3fe05d07@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9f90c2b60912020925x20b23582m891627bc3fe05d07@mail-gmail-com%3e</id>
<updated>2009-12-02T17:25:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Ok. Now it is much clear. Thx for explaining.

Evgeny.

2009/12/2 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt; Hi Evgeny,
&gt;
&gt; Let me take this to dev... Thanks for providing all the information on the
&gt; issue and working on the fix. This is rather valuable to Cayenne, as your
&gt; system has a number of use cases that seem to be pretty unique in this
&gt; community, and you can find things that nobody else will. (Also hope that
&gt; your Apache account will be created soon, so that you can take over this
&gt; Jira and commit it yourself)
&gt;
&gt;&gt; As you wrote: "Cayenne Mapping can only contain JDBC types"
&gt;
&gt; Let me clarify. This was referring to the DB part of the mapping. On the
&gt; Java part we can map any custom types. And we do in fact. Cayenne is
&gt; definitely not limited to the types listed in the JDBC spec, again on the
&gt; object end of the mapping.
&gt;
&gt;&gt; How to fix... mm have thoughts that OracleAdapter can help us... need some
&gt;&gt; time to look there inside
&gt;
&gt; Yes please.
&gt;
&gt; Let me comment on the fix versions to avoid misunderstanding. The fix
&gt; versions will depend on the nature of the fix and the definition of the
&gt; problem. Just returning an Oracle type from an unmapped query is IMO not a
&gt; bug (actually it looks more like a bug in Oracle driver from your examples,
&gt; and what I found via Google). On the other hand returning correct value from
&gt; SQLTemplate with an explicit #result(), is something that we need to handle
&gt; correctly ourselves.
&gt;
&gt; So the second case should probably be fixed on all stable branches.
&gt;
&gt; The first case would require us to redefine how Cayenne works. For instance
&gt; we may decide that from 3.1 all Oracle internal types should be converted to
&gt; JDBC default types (unless otherwise specified by the user). But we won't be
&gt; able to include that change in the "stable" releases.
&gt;
&gt; Andrus
&gt;
&gt;
&gt; On Dec 2, 2009, at 6:16 PM, Evgeny Ryabitskiy (JIRA) wrote:
&gt;&gt;
&gt;&gt;   [
&gt;&gt; https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784887#action_12784887
&gt;&gt; ]
&gt;&gt;
&gt;&gt; Evgeny Ryabitskiy commented on CAY-1323:
&gt;&gt; ----------------------------------------
&gt;&gt;
&gt;&gt; I think I finished my Investigation. If you wish I can add some JUnit for
&gt;&gt; this UC.
&gt;&gt;
&gt;&gt; You can add "Fix Version" as you wish. But I think it should be fixed in
&gt;&gt; all branches (1.0, 2.0, 3.0).
&gt;&gt; It is no expectable behavior.... As you wrote: "Cayenne Mapping can only
&gt;&gt; contain JDBC types"
&gt;&gt;
&gt;&gt; How to fix... mm have thoughts that OracleAdapter can help us... need some
&gt;&gt; time to look there inside
&gt;&gt;
&gt;&gt;&gt; oracle.sql.TIMESTAMP in Result of query
&gt;&gt;&gt; ---------------------------------------
&gt;&gt;&gt;
&gt;&gt;&gt;               Key: CAY-1323
&gt;&gt;&gt;               URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;&gt;&gt;           Project: Cayenne
&gt;&gt;&gt;        Issue Type: Bug
&gt;&gt;&gt;        Components: Cayenne Core Library
&gt;&gt;&gt;  Affects Versions: 2.0.5, 3.0 beta 1
&gt;&gt;&gt;          Reporter: Evgeny Ryabitskiy
&gt;&gt;&gt;          Assignee: Andrus Adamchik
&gt;&gt;&gt;       Attachments: cayenne.xml, OracleTimestampTest.java,
&gt;&gt;&gt; OracleTimestampTestMap.map.xml
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Result of query from column of timestamp type was mapped to
&gt;&gt;&gt; oracle.sql.TIMESTAMP.
&gt;&gt;&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt;&gt;&gt; I am using latest official Oracle JDBC driver.
&gt;&gt;
&gt;&gt; --
&gt;&gt; This message is automatically generated by JIRA.
&gt;&gt; -
&gt;&gt; You can reply to this email to add a comment to the issue online.
&gt;&gt;
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c208C13B6-C979-4CC9-8155-F6D4DA23CEF8@objectstyle.org%3e"/>
<id>urn:uuid:%3c208C13B6-C979-4CC9-8155-F6D4DA23CEF8@objectstyle-org%3e</id>
<updated>2009-12-02T16:38:36Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Evgeny,

Let me take this to dev... Thanks for providing all the information on  
the issue and working on the fix. This is rather valuable to Cayenne,  
as your system has a number of use cases that seem to be pretty unique  
in this community, and you can find things that nobody else will.  
(Also hope that your Apache account will be created soon, so that you  
can take over this Jira and commit it yourself)

&gt; As you wrote: "Cayenne Mapping can only contain JDBC types"

Let me clarify. This was referring to the DB part of the mapping. On  
the Java part we can map any custom types. And we do in fact. Cayenne  
is definitely not limited to the types listed in the JDBC spec, again  
on the object end of the mapping.

&gt; How to fix... mm have thoughts that OracleAdapter can help us...  
&gt; need some time to look there inside

Yes please.

Let me comment on the fix versions to avoid misunderstanding. The fix  
versions will depend on the nature of the fix and the definition of  
the problem. Just returning an Oracle type from an unmapped query is  
IMO not a bug (actually it looks more like a bug in Oracle driver from  
your examples, and what I found via Google). On the other hand  
returning correct value from SQLTemplate with an explicit #result(),  
is something that we need to handle correctly ourselves.

So the second case should probably be fixed on all stable branches.

The first case would require us to redefine how Cayenne works. For  
instance we may decide that from 3.1 all Oracle internal types should  
be converted to JDBC default types (unless otherwise specified by the  
user). But we won't be able to include that change in the "stable"  
releases.

Andrus


On Dec 2, 2009, at 6:16 PM, Evgeny Ryabitskiy (JIRA) wrote:
&gt;    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784887

&gt; #action_12784887 ]
&gt;
&gt; Evgeny Ryabitskiy commented on CAY-1323:
&gt; ----------------------------------------
&gt;
&gt; I think I finished my Investigation. If you wish I can add some  
&gt; JUnit for this UC.
&gt;
&gt; You can add "Fix Version" as you wish. But I think it should be  
&gt; fixed in all branches (1.0, 2.0, 3.0).
&gt; It is no expectable behavior.... As you wrote: "Cayenne Mapping can  
&gt; only contain JDBC types"
&gt;
&gt; How to fix... mm have thoughts that OracleAdapter can help us...  
&gt; need some time to look there inside
&gt;
&gt;&gt; oracle.sql.TIMESTAMP in Result of query
&gt;&gt; ---------------------------------------
&gt;&gt;
&gt;&gt;                Key: CAY-1323
&gt;&gt;                URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;&gt;            Project: Cayenne
&gt;&gt;         Issue Type: Bug
&gt;&gt;         Components: Cayenne Core Library
&gt;&gt;   Affects Versions: 2.0.5, 3.0 beta 1
&gt;&gt;           Reporter: Evgeny Ryabitskiy
&gt;&gt;           Assignee: Andrus Adamchik
&gt;&gt;        Attachments: cayenne.xml, OracleTimestampTest.java,  
&gt;&gt; OracleTimestampTestMap.map.xml
&gt;&gt;
&gt;&gt;
&gt;&gt; Result of query from column of timestamp type was mapped to  
&gt;&gt; oracle.sql.TIMESTAMP.
&gt;&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt;&gt; I am using latest official Oracle JDBC driver.
&gt;
&gt; -- 
&gt; This message is automatically generated by JIRA.
&gt; -
&gt; You can reply to this email to add a comment to the issue online.
&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Created: (CAY-1324) Update quick start tutorials</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c7C3C81EA-D6B8-4CE9-83B3-DEB19FA351F6@objectstyle.org%3e"/>
<id>urn:uuid:%3c7C3C81EA-D6B8-4CE9-83B3-DEB19FA351F6@objectstyle-org%3e</id>
<updated>2009-12-02T10:45:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Yep. Thanks for mentioning. I'll add it to the TODO list.

Andrus

On Dec 2, 2009, at 12:41 PM, Andrey Razumovsky wrote:

&gt; Hi Andrus,
&gt;
&gt; Can we also have some docs for embeddables? It'd be great to see some
&gt; examples
&gt;
&gt; -- 
&gt; Andrey



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Created: (CAY-1324) Update quick start tutorials</title>
<author><name>Andrey Razumovsky &lt;razumovsky.andrey@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3219fff70912020241q267a1b69q7c70bf4a1777a025@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3219fff70912020241q267a1b69q7c70bf4a1777a025@mail-gmail-com%3e</id>
<updated>2009-12-02T10:41:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Andrus,

Can we also have some docs for embeddables? It'd be great to see some
examples

-- 
Andrey


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple  transactions?</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c712BE7E0-15A4-40B0-8FCA-3638352AD5DC@objectstyle.org%3e"/>
<id>urn:uuid:%3c712BE7E0-15A4-40B0-8FCA-3638352AD5DC@objectstyle-org%3e</id>
<updated>2009-12-02T07:31:01Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Sure. I am fine with keeping it as well. I guess this is mainly a  
documentation issue - it has to be mentioned that this is just one  
possible usage pattern, not *the* way to access ObjectContext.

Andrus

On Dec 1, 2009, at 8:51 PM, Michael Gentry wrote:

&gt; I agree with Andrey here.  I think it is better for Cayenne to provide
&gt; this in a consistent/standardized way for those who want it rather
&gt; than requiring people to roll their own each time.  Those who need
&gt; something more complex can implement something more complex, but let's
&gt; keep the common case easy/standard.
&gt;
&gt; mrg
&gt;
&gt;
&gt; On Tue, Dec 1, 2009 at 1:29 PM, Andrey Razumovsky
&gt; &lt;razumovsky.andrey@gmail.com&gt; wrote:
&gt;&gt; 2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt;&gt;
&gt;&gt;&gt; This is just a convenience in Cayenne. Nobody's forced to use it.  
&gt;&gt;&gt; I will go
&gt;&gt;&gt; as far as to suggest to remove it from Cayenne 3.1 as a built-in  
&gt;&gt;&gt; feature,
&gt;&gt;&gt; and just document it as a possible design pattern in a user  
&gt;&gt;&gt; application.
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt; I'm -1. We can see some profit in moving it from BC class (say, to  
&gt;&gt; new
&gt;&gt; "Cayenne" utility). But I'm sure it is widely used by everyone who  
&gt;&gt; uses
&gt;&gt; Cayenne in web apps (or maybe even in desktop apps)
&gt;&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple	transactions?</title>
<author><name>Michael Gentry &lt;mgentry@masslight.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c5adb61290912011051s7226ee9bmec7a97e53fa2ff68@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5adb61290912011051s7226ee9bmec7a97e53fa2ff68@mail-gmail-com%3e</id>
<updated>2009-12-01T18:51:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I agree with Andrey here.  I think it is better for Cayenne to provide
this in a consistent/standardized way for those who want it rather
than requiring people to roll their own each time.  Those who need
something more complex can implement something more complex, but let's
keep the common case easy/standard.

mrg


On Tue, Dec 1, 2009 at 1:29 PM, Andrey Razumovsky
&lt;razumovsky.andrey@gmail.com&gt; wrote:
&gt; 2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt;
&gt;&gt; This is just a convenience in Cayenne. Nobody's forced to use it. I will go
&gt;&gt; as far as to suggest to remove it from Cayenne 3.1 as a built-in feature,
&gt;&gt; and just document it as a possible design pattern in a user application.
&gt;&gt;
&gt;&gt;
&gt; I'm -1. We can see some profit in moving it from BC class (say, to new
&gt; "Cayenne" utility). But I'm sure it is widely used by everyone who uses
&gt; Cayenne in web apps (or maybe even in desktop apps)
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple	transactions?</title>
<author><name>Andrey Razumovsky &lt;razumovsky.andrey@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c3219fff70912011029u622e4068ja177c584909ab035@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3219fff70912011029u622e4068ja177c584909ab035@mail-gmail-com%3e</id>
<updated>2009-12-01T18:29:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;

&gt; This is just a convenience in Cayenne. Nobody's forced to use it. I will go
&gt; as far as to suggest to remove it from Cayenne 3.1 as a built-in feature,
&gt; and just document it as a possible design pattern in a user application.
&gt;
&gt;
I'm -1. We can see some profit in moving it from BC class (say, to new
"Cayenne" utility). But I'm sure it is widely used by everyone who uses
Cayenne in web apps (or maybe even in desktop apps)


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple  transactions?</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3cE16B79F3-669D-483C-AF5F-333041FCA44A@objectstyle.org%3e"/>
<id>urn:uuid:%3cE16B79F3-669D-483C-AF5F-333041FCA44A@objectstyle-org%3e</id>
<updated>2009-12-01T16:20:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Dec 1, 2009, at 6:12 PM, Evgeny Ryabitskiy wrote:

&gt; Transaction is not aggregated
&gt; to DataDomain (inside called static method of Transaction class) how I
&gt; was thinking before.

Well, Domain acts as a factory for the transaction, based on its own  
configuration. In 3.1 we'll have a DI container that is a factory of  
everything. Although there will be 1 DI container per Domain. So it is  
not going to change in 3.1.


&gt; Callbacks can be add after initialization as a set of Delegates (now
&gt; there can be only one so I can't say this transaction is fully
&gt; cross-domain working).

Yeah I also don't like a single delegate model (and may change that in  
3.1). Nothing would prevent you from aggregating multiple delegates  
within one delegate on your own, but since we are talking about  
possible improvements, this is a valid point.

Andrus


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple	transactions?</title>
<author><name>Evgeny Ryabitskiy &lt;evgeny.ryabitskiy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c9f90c2b60912010812q39d3ea61v4d840277c035e847@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9f90c2b60912010812q39d3ea61v4d840277c035e847@mail-gmail-com%3e</id>
<updated>2009-12-01T16:12:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&gt; if you have ideas,  let's discuss them.

So first my idea is to change this method (It's confusing!!!):

domain.createTransaction();

A spend some time looking through code. Transaction is not aggregated
to DataDomain (inside called static method of Transaction class) how I
was thinking before. Only thing why it's where is parameter with
defines to use External or Internal Transaction and... some Delegate
for callbacks.
If it's singleton and can be used across several DataDomains it should
be more oblivious if we initialize it as a Singleton via static
method.

Callbacks can be add after initialization as a set of Delegates (now
there can be only one so I can't say this transaction is fully
cross-domain working).
What I want to say: If we are using it as Singleton (in scope of one
thread) then let's make it friendly-user singleton, not a headache for
developers who are constructing huge system with multiple domains :)

Evgeny.

&gt;
&gt;&gt;&gt; transactions, and while addressing one use case it breaks others (i.e.
&gt;&gt;&gt; other
&gt;&gt;&gt; users may need a single commit point across multiple DataDomains).
&gt;&gt;
&gt;&gt; Ok. Actually I has no differences between several domain-local
&gt;&gt; transactions and one huge that is across multiple DataDomains.
&gt;&gt; The question is Transaction is working well across multiple DataDomains?
&gt;
&gt; There's nothing magical about Transactions. In Cayenne they are a store of
&gt; JDBC Connection to ensure that multiple sub-operations within a given
&gt; operation get the same connection and consequently operate on the same db
&gt; data version.
&gt;
&gt; 2 possible caveats between domains when they reuse transactions:
&gt;
&gt; * They should both use either external or internal transactions (i.e. the
&gt; same transaction strategy).
&gt; * If they want completely separate connections, DataNode names should not
&gt; match. If they want to reuse connections from each other, they DataNode
&gt; names should match.
&gt;
&gt; Andrus
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple  transactions?</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3cBA8A0147-A7E6-4BEC-8499-751A90C609D8@objectstyle.org%3e"/>
<id>urn:uuid:%3cBA8A0147-A7E6-4BEC-8499-751A90C609D8@objectstyle-org%3e</id>
<updated>2009-12-01T15:00:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Dec 1, 2009, at 4:29 PM, Evgeny Ryabitskiy wrote:

&gt; It's a crutch :/

Possibly. If we are to redesign public transaction API in Cayenne,  
let's looks at the big picture then and see what problems we are  
trying to solve. IIRC it was mentioned before that we can make  
*manual* transaction management more user-friendly (automatic is as  
friendly as it gets)... I am not sure how (or rather my ideas go in  
the direction of allowing attaching arbitrary objects to transactions,  
maybe not something you care about), but if you have ideas,  let's  
discuss them.

&gt;&gt; transactions, and while addressing one use case it breaks others  
&gt;&gt; (i.e. other
&gt;&gt; users may need a single commit point across multiple DataDomains).
&gt;
&gt; Ok. Actually I has no differences between several domain-local
&gt; transactions and one huge that is across multiple DataDomains.
&gt; The question is Transaction is working well across multiple  
&gt; DataDomains?

There's nothing magical about Transactions. In Cayenne they are a  
store of JDBC Connection to ensure that multiple sub-operations within  
a given operation get the same connection and consequently operate on  
the same db data version.

2 possible caveats between domains when they reuse transactions:

* They should both use either external or internal transactions (i.e.  
the same transaction strategy).
* If they want completely separate connections, DataNode names should  
not match. If they want to reuse connections from each other, they  
DataNode names should match.

Andrus







</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple	transactions?</title>
<author><name>Evgeny Ryabitskiy &lt;evgeny.ryabitskiy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c9f90c2b60912010629r578f2229k548134c67440d1e2@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9f90c2b60912010629r578f2229k548134c67440d1e2@mail-gmail-com%3e</id>
<updated>2009-12-01T14:29:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&gt; So here is how you can address your problem - unbind outer transaction from
&gt; the thread when the nested transaction is started, and then rebind it back
&gt; after inner commit/rollback:
&gt;
&gt; Transaction outer = Transaction.getThreadTransaction();
&gt; try {
&gt;   Transaction inner = ... // create
&gt;   Transaction.bindThreadTransaction(inner);
&gt;
&gt;   ... // do work
&gt; }
&gt; finally {
&gt;   Transaction.bindThreadTransaction(outer);
&gt; }

It's a crutch :/

&gt; transactions, and while addressing one use case it breaks others (i.e. other
&gt; users may need a single commit point across multiple DataDomains).

Ok. Actually I has no differences between several domain-local
transactions and one huge that is across multiple DataDomains.
The question is Transaction is working well across multiple DataDomains?
When I am looking at code and see: someDomain.createTransaction() I
don't expect for this transaction to work across another
DataDomain....

Evgeny.

&gt;
&gt; On Dec 1, 2009, at 3:41 PM, Evgeny Ryabitskiy wrote:
&gt;
&gt;&gt; Manual? I create them manually by calling domain1.createTransaction()
&gt;&gt; and domain2.createTransaction().
&gt;&gt;
&gt;&gt; How it happen: One method from Module 1 do some queries (first domain)
&gt;&gt; then call method from Module 2 that is also doing some queries (second
&gt;&gt; domain), after method from module 2 finished: method from module 1 is
&gt;&gt; doing more queries.
&gt;&gt;
&gt;&gt; So it's like an "nested" transaction (from mod 2) but is performed on
&gt;&gt; another DataDomain (it's another DB server) and absolutely isolated
&gt;&gt; from huge "outer" transaction (mod 1).
&gt;&gt; But I want to control both! and separately...
&gt;&gt;
&gt;&gt; Evgeny.
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; 2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt;&gt;&gt;
&gt;&gt;&gt; Are those manual transactions? (I.e. how does it happen that transaction
&gt;&gt;&gt; scopes overlap between two queries?)
&gt;&gt;&gt;
&gt;&gt;&gt; Also you can reuse the current thread transaction between multiple
&gt;&gt;&gt; domains.
&gt;&gt;&gt; As I said, connections are scoped by DataNode name, so the same
&gt;&gt;&gt; transaction
&gt;&gt;&gt; will return 2 separate connections for 2 queries run against 2 different
&gt;&gt;&gt; nodes.
&gt;&gt;&gt;
&gt;&gt;&gt; Andrus
&gt;&gt;&gt;
&gt;&gt;&gt; On Dec 1, 2009, at 3:27 PM, Evgeny Ryabitskiy wrote:
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Problem in multiple Domains.
&gt;&gt;&gt;&gt; When I am creating transaction I am creating it's for specific
&gt;&gt;&gt;&gt; DataDomain (like a DataContext).
&gt;&gt;&gt;&gt; When I have 2 Modules with dedicated DataDomains (so it will be 2
&gt;&gt;&gt;&gt; DataDomains) I can create 2 Transactions
&gt;&gt;&gt;&gt; (domain.createTransaction()).
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; But to thread I can bind only one. Then when I start performing queries
&gt;&gt;&gt;&gt; I
&gt;&gt;&gt;&gt; got:
&gt;&gt;&gt;&gt; 1)First Domain Transaction is binded and handled normally
&gt;&gt;&gt;&gt; 2)Second Domain Transaction is override by first DataDomain. So when I
&gt;&gt;&gt;&gt; perform query for second: ThreadLocals return Transaction for firs
&gt;&gt;&gt;&gt; Domain.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Evgeny
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; 2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Singletons are bad in a general purpose framework, like Cayenne. No
&gt;&gt;&gt;&gt;&gt; question
&gt;&gt;&gt;&gt;&gt; about that. Per your description even thread-local singletons can be
a
&gt;&gt;&gt;&gt;&gt; problem, which is less obvious to me, but I guess real in some
&gt;&gt;&gt;&gt;&gt; circumstances. So let's see what those are.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt;&gt;&gt;&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt;&gt;&gt;&gt;&gt; thread)
&gt;&gt;&gt;&gt;&gt;&gt; //also spend some time
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; This is just a convenience in Cayenne. Nobody's forced to use it. I
&gt;&gt;&gt;&gt;&gt; will
&gt;&gt;&gt;&gt;&gt; go
&gt;&gt;&gt;&gt;&gt; as far as to suggest to remove it from Cayenne 3.1 as a built-in
&gt;&gt;&gt;&gt;&gt; feature,
&gt;&gt;&gt;&gt;&gt; and just document it as a possible design pattern in a user
&gt;&gt;&gt;&gt;&gt; application.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt;&gt;&gt; this is killing one!!!
&gt;&gt;&gt;&gt;&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt;&gt;&gt;&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt;&gt;&gt;&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt;&gt;&gt; And that is really huge problem for me.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; J2EE pattern of tying a transaction to an execution thread, even if
&gt;&gt;&gt;&gt;&gt; multiple
&gt;&gt;&gt;&gt;&gt; data sources are involved, makes sense as it allows to commit/rollback
&gt;&gt;&gt;&gt;&gt; multiple things at once. Cayenne Transaction sort of follows that. JDBC
&gt;&gt;&gt;&gt;&gt; connections within the transaction are scoped by DataNode name. So what
&gt;&gt;&gt;&gt;&gt; exactly is the problem?
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Andrus
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; On Dec 1, 2009, at 2:44 PM, Evgeny Ryabitskiy wrote:
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; Hello 2 everyone!
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; Today I one more time thinking about singleton pattern and it's hard
&gt;&gt;&gt;&gt;&gt;&gt; usssage in Cayenne.
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; So.. I have several modules, each has own DomainConfig file and
&gt;&gt;&gt;&gt;&gt;&gt; connection to it's DataBase. Sometimes there can be used different
DB
&gt;&gt;&gt;&gt;&gt;&gt; servers and even different DB types (usually it's Oracle and MS SQL,
&gt;&gt;&gt;&gt;&gt;&gt; sometimes Sybase).
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; Singletons:
&gt;&gt;&gt;&gt;&gt;&gt; 1) Configuration.getSharedConfiguration()
&gt;&gt;&gt;&gt;&gt;&gt; This problem is solved:
&gt;&gt;&gt;&gt;&gt;&gt; DefaultConfiguration conf = new
&gt;&gt;&gt;&gt;&gt;&gt; DefaultConfiguration("module1-cayenne.xml");
&gt;&gt;&gt;&gt;&gt;&gt; conf .initialize;
&gt;&gt;&gt;&gt;&gt;&gt; conf.getDomain();
&gt;&gt;&gt;&gt;&gt;&gt; //spend some time to find solution... everywhere examples with
&gt;&gt;&gt;&gt;&gt;&gt; SharedConfiguration
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt;&gt;&gt;&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt;&gt;&gt;&gt;&gt; thread)
&gt;&gt;&gt;&gt;&gt;&gt; //also spend some time
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt;&gt;&gt; this is killing one!!!
&gt;&gt;&gt;&gt;&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt;&gt;&gt;&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt;&gt;&gt;&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt;&gt;&gt; And that is really huge problem for me.
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; So me suggestion is to move this ThreadLocal to DataDomain. Still
can
&gt;&gt;&gt;&gt;&gt;&gt; use singleton API for standalone applications.
&gt;&gt;&gt;&gt;&gt;&gt; Also we can move DataContext to DataDomain.
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; Evgeny.
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple  transactions?</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3cB07CD1E6-EB1D-4EEF-A7AB-8843C677B248@objectstyle.org%3e"/>
<id>urn:uuid:%3cB07CD1E6-EB1D-4EEF-A7AB-8843C677B248@objectstyle-org%3e</id>
<updated>2009-12-01T13:56:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Calling Cayenne transactions "singletons" is not really accurate, as  
they are thread-local and scoped, and you can control that scope if  
you have to. So here is how you can address your problem - unbind  
outer transaction from the thread when the nested transaction is  
started, and then rebind it back after inner commit/rollback:

Transaction outer = Transaction.getThreadTransaction();
try {
    Transaction inner = ... // create
    Transaction.bindThreadTransaction(inner);

    ... // do work
}
finally {
    Transaction.bindThreadTransaction(outer);
}

I am undecided on whether DataDomain-scoped transactions is a good  
idea going forward. This goes against most J2EE users expectations  
about transactions, and while addressing one use case it breaks others  
(i.e. other users may need a single commit point across multiple  
DataDomains).

Andrus


On Dec 1, 2009, at 3:41 PM, Evgeny Ryabitskiy wrote:

&gt; Manual? I create them manually by calling domain1.createTransaction()
&gt; and domain2.createTransaction().
&gt;
&gt; How it happen: One method from Module 1 do some queries (first domain)
&gt; then call method from Module 2 that is also doing some queries (second
&gt; domain), after method from module 2 finished: method from module 1 is
&gt; doing more queries.
&gt;
&gt; So it's like an "nested" transaction (from mod 2) but is performed on
&gt; another DataDomain (it's another DB server) and absolutely isolated
&gt; from huge "outer" transaction (mod 1).
&gt; But I want to control both! and separately...
&gt;
&gt; Evgeny.
&gt;
&gt;
&gt;
&gt; 2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt;&gt; Are those manual transactions? (I.e. how does it happen that  
&gt;&gt; transaction
&gt;&gt; scopes overlap between two queries?)
&gt;&gt;
&gt;&gt; Also you can reuse the current thread transaction between multiple  
&gt;&gt; domains.
&gt;&gt; As I said, connections are scoped by DataNode name, so the same  
&gt;&gt; transaction
&gt;&gt; will return 2 separate connections for 2 queries run against 2  
&gt;&gt; different
&gt;&gt; nodes.
&gt;&gt;
&gt;&gt; Andrus
&gt;&gt;
&gt;&gt; On Dec 1, 2009, at 3:27 PM, Evgeny Ryabitskiy wrote:
&gt;&gt;
&gt;&gt;&gt; Problem in multiple Domains.
&gt;&gt;&gt; When I am creating transaction I am creating it's for specific
&gt;&gt;&gt; DataDomain (like a DataContext).
&gt;&gt;&gt; When I have 2 Modules with dedicated DataDomains (so it will be 2
&gt;&gt;&gt; DataDomains) I can create 2 Transactions
&gt;&gt;&gt; (domain.createTransaction()).
&gt;&gt;&gt;
&gt;&gt;&gt; But to thread I can bind only one. Then when I start performing  
&gt;&gt;&gt; queries I
&gt;&gt;&gt; got:
&gt;&gt;&gt; 1)First Domain Transaction is binded and handled normally
&gt;&gt;&gt; 2)Second Domain Transaction is override by first DataDomain. So  
&gt;&gt;&gt; when I
&gt;&gt;&gt; perform query for second: ThreadLocals return Transaction for firs
&gt;&gt;&gt; Domain.
&gt;&gt;&gt;
&gt;&gt;&gt; Evgeny
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; 2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Singletons are bad in a general purpose framework, like Cayenne. No
&gt;&gt;&gt;&gt; question
&gt;&gt;&gt;&gt; about that. Per your description even thread-local singletons can  
&gt;&gt;&gt;&gt; be a
&gt;&gt;&gt;&gt; problem, which is less obvious to me, but I guess real in some
&gt;&gt;&gt;&gt; circumstances. So let's see what those are.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt;&gt;&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in  
&gt;&gt;&gt;&gt;&gt; one
&gt;&gt;&gt;&gt;&gt; thread)
&gt;&gt;&gt;&gt;&gt; //also spend some time
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; This is just a convenience in Cayenne. Nobody's forced to use it.  
&gt;&gt;&gt;&gt; I will
&gt;&gt;&gt;&gt; go
&gt;&gt;&gt;&gt; as far as to suggest to remove it from Cayenne 3.1 as a built-in  
&gt;&gt;&gt;&gt; feature,
&gt;&gt;&gt;&gt; and just document it as a possible design pattern in a user  
&gt;&gt;&gt;&gt; application.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt;&gt; this is killing one!!!
&gt;&gt;&gt;&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt;&gt;&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt;&gt;&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt;&gt; And that is really huge problem for me.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; J2EE pattern of tying a transaction to an execution thread, even if
&gt;&gt;&gt;&gt; multiple
&gt;&gt;&gt;&gt; data sources are involved, makes sense as it allows to commit/ 
&gt;&gt;&gt;&gt; rollback
&gt;&gt;&gt;&gt; multiple things at once. Cayenne Transaction sort of follows  
&gt;&gt;&gt;&gt; that. JDBC
&gt;&gt;&gt;&gt; connections within the transaction are scoped by DataNode name.  
&gt;&gt;&gt;&gt; So what
&gt;&gt;&gt;&gt; exactly is the problem?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Andrus
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; On Dec 1, 2009, at 2:44 PM, Evgeny Ryabitskiy wrote:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Hello 2 everyone!
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Today I one more time thinking about singleton pattern and it's  
&gt;&gt;&gt;&gt;&gt; hard
&gt;&gt;&gt;&gt;&gt; usssage in Cayenne.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; So.. I have several modules, each has own DomainConfig file and
&gt;&gt;&gt;&gt;&gt; connection to it's DataBase. Sometimes there can be used  
&gt;&gt;&gt;&gt;&gt; different DB
&gt;&gt;&gt;&gt;&gt; servers and even different DB types (usually it's Oracle and MS  
&gt;&gt;&gt;&gt;&gt; SQL,
&gt;&gt;&gt;&gt;&gt; sometimes Sybase).
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Singletons:
&gt;&gt;&gt;&gt;&gt; 1) Configuration.getSharedConfiguration()
&gt;&gt;&gt;&gt;&gt; This problem is solved:
&gt;&gt;&gt;&gt;&gt; DefaultConfiguration conf = new
&gt;&gt;&gt;&gt;&gt; DefaultConfiguration("module1-cayenne.xml");
&gt;&gt;&gt;&gt;&gt; conf .initialize;
&gt;&gt;&gt;&gt;&gt; conf.getDomain();
&gt;&gt;&gt;&gt;&gt; //spend some time to find solution... everywhere examples with
&gt;&gt;&gt;&gt;&gt; SharedConfiguration
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt;&gt;&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in  
&gt;&gt;&gt;&gt;&gt; one
&gt;&gt;&gt;&gt;&gt; thread)
&gt;&gt;&gt;&gt;&gt; //also spend some time
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt;&gt; this is killing one!!!
&gt;&gt;&gt;&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt;&gt;&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt;&gt;&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt;&gt; And that is really huge problem for me.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; So me suggestion is to move this ThreadLocal to DataDomain.  
&gt;&gt;&gt;&gt;&gt; Still can
&gt;&gt;&gt;&gt;&gt; use singleton API for standalone applications.
&gt;&gt;&gt;&gt;&gt; Also we can move DataContext to DataDomain.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Evgeny.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple	transactions?</title>
<author><name>Evgeny Ryabitskiy &lt;evgeny.ryabitskiy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c9f90c2b60912010541h70242988y5937ebe74ca8a292@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9f90c2b60912010541h70242988y5937ebe74ca8a292@mail-gmail-com%3e</id>
<updated>2009-12-01T13:41:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Manual? I create them manually by calling domain1.createTransaction()
and domain2.createTransaction().

How it happen: One method from Module 1 do some queries (first domain)
then call method from Module 2 that is also doing some queries (second
domain), after method from module 2 finished: method from module 1 is
doing more queries.

So it's like an "nested" transaction (from mod 2) but is performed on
another DataDomain (it's another DB server) and absolutely isolated
from huge "outer" transaction (mod 1).
 But I want to control both! and separately...

Evgeny.



2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt; Are those manual transactions? (I.e. how does it happen that transaction
&gt; scopes overlap between two queries?)
&gt;
&gt; Also you can reuse the current thread transaction between multiple domains.
&gt; As I said, connections are scoped by DataNode name, so the same transaction
&gt; will return 2 separate connections for 2 queries run against 2 different
&gt; nodes.
&gt;
&gt; Andrus
&gt;
&gt; On Dec 1, 2009, at 3:27 PM, Evgeny Ryabitskiy wrote:
&gt;
&gt;&gt; Problem in multiple Domains.
&gt;&gt; When I am creating transaction I am creating it's for specific
&gt;&gt; DataDomain (like a DataContext).
&gt;&gt; When I have 2 Modules with dedicated DataDomains (so it will be 2
&gt;&gt; DataDomains) I can create 2 Transactions
&gt;&gt; (domain.createTransaction()).
&gt;&gt;
&gt;&gt; But to thread I can bind only one. Then when I start performing queries I
&gt;&gt; got:
&gt;&gt; 1)First Domain Transaction is binded and handled normally
&gt;&gt; 2)Second Domain Transaction is override by first DataDomain. So when I
&gt;&gt; perform query for second: ThreadLocals return Transaction for firs
&gt;&gt; Domain.
&gt;&gt;
&gt;&gt; Evgeny
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; 2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt;&gt;&gt;
&gt;&gt;&gt; Singletons are bad in a general purpose framework, like Cayenne. No
&gt;&gt;&gt; question
&gt;&gt;&gt; about that. Per your description even thread-local singletons can be a
&gt;&gt;&gt; problem, which is less obvious to me, but I guess real in some
&gt;&gt;&gt; circumstances. So let's see what those are.
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt;&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt;&gt;&gt; thread)
&gt;&gt;&gt;&gt; //also spend some time
&gt;&gt;&gt;
&gt;&gt;&gt; This is just a convenience in Cayenne. Nobody's forced to use it. I will
&gt;&gt;&gt; go
&gt;&gt;&gt; as far as to suggest to remove it from Cayenne 3.1 as a built-in feature,
&gt;&gt;&gt; and just document it as a possible design pattern in a user application.
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt; this is killing one!!!
&gt;&gt;&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt;&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt;&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt; And that is really huge problem for me.
&gt;&gt;&gt;
&gt;&gt;&gt; J2EE pattern of tying a transaction to an execution thread, even if
&gt;&gt;&gt; multiple
&gt;&gt;&gt; data sources are involved, makes sense as it allows to commit/rollback
&gt;&gt;&gt; multiple things at once. Cayenne Transaction sort of follows that. JDBC
&gt;&gt;&gt; connections within the transaction are scoped by DataNode name. So what
&gt;&gt;&gt; exactly is the problem?
&gt;&gt;&gt;
&gt;&gt;&gt; Andrus
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; On Dec 1, 2009, at 2:44 PM, Evgeny Ryabitskiy wrote:
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Hello 2 everyone!
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Today I one more time thinking about singleton pattern and it's hard
&gt;&gt;&gt;&gt; usssage in Cayenne.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; So.. I have several modules, each has own DomainConfig file and
&gt;&gt;&gt;&gt; connection to it's DataBase. Sometimes there can be used different DB
&gt;&gt;&gt;&gt; servers and even different DB types (usually it's Oracle and MS SQL,
&gt;&gt;&gt;&gt; sometimes Sybase).
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Singletons:
&gt;&gt;&gt;&gt; 1) Configuration.getSharedConfiguration()
&gt;&gt;&gt;&gt; This problem is solved:
&gt;&gt;&gt;&gt; DefaultConfiguration conf = new
&gt;&gt;&gt;&gt; DefaultConfiguration("module1-cayenne.xml");
&gt;&gt;&gt;&gt; conf .initialize;
&gt;&gt;&gt;&gt; conf.getDomain();
&gt;&gt;&gt;&gt; //spend some time to find solution... everywhere examples with
&gt;&gt;&gt;&gt; SharedConfiguration
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt;&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt;&gt;&gt; thread)
&gt;&gt;&gt;&gt; //also spend some time
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt; this is killing one!!!
&gt;&gt;&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt;&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt;&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt;&gt;&gt; And that is really huge problem for me.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; So me suggestion is to move this ThreadLocal to DataDomain. Still can
&gt;&gt;&gt;&gt; use singleton API for standalone applications.
&gt;&gt;&gt;&gt; Also we can move DataContext to DataDomain.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Evgeny.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple  transactions?</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3cEC9D3E82-43F4-4742-8A13-1D97C31CB8B6@objectstyle.org%3e"/>
<id>urn:uuid:%3cEC9D3E82-43F4-4742-8A13-1D97C31CB8B6@objectstyle-org%3e</id>
<updated>2009-12-01T13:31:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Are those manual transactions? (I.e. how does it happen that  
transaction scopes overlap between two queries?)

Also you can reuse the current thread transaction between multiple  
domains. As I said, connections are scoped by DataNode name, so the  
same transaction will return 2 separate connections for 2 queries run  
against 2 different nodes.

Andrus

On Dec 1, 2009, at 3:27 PM, Evgeny Ryabitskiy wrote:

&gt; Problem in multiple Domains.
&gt; When I am creating transaction I am creating it's for specific
&gt; DataDomain (like a DataContext).
&gt; When I have 2 Modules with dedicated DataDomains (so it will be 2
&gt; DataDomains) I can create 2 Transactions
&gt; (domain.createTransaction()).
&gt;
&gt; But to thread I can bind only one. Then when I start performing  
&gt; queries I got:
&gt; 1)First Domain Transaction is binded and handled normally
&gt; 2)Second Domain Transaction is override by first DataDomain. So when I
&gt; perform query for second: ThreadLocals return Transaction for firs
&gt; Domain.
&gt;
&gt; Evgeny
&gt;
&gt;
&gt;
&gt; 2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt;&gt; Singletons are bad in a general purpose framework, like Cayenne. No  
&gt;&gt; question
&gt;&gt; about that. Per your description even thread-local singletons can  
&gt;&gt; be a
&gt;&gt; problem, which is less obvious to me, but I guess real in some
&gt;&gt; circumstances. So let's see what those are.
&gt;&gt;
&gt;&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt;&gt; thread)
&gt;&gt;&gt; //also spend some time
&gt;&gt;
&gt;&gt; This is just a convenience in Cayenne. Nobody's forced to use it. I  
&gt;&gt; will go
&gt;&gt; as far as to suggest to remove it from Cayenne 3.1 as a built-in  
&gt;&gt; feature,
&gt;&gt; and just document it as a possible design pattern in a user  
&gt;&gt; application.
&gt;&gt;
&gt;&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt;&gt; this is killing one!!!
&gt;&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt;&gt; And that is really huge problem for me.
&gt;&gt;
&gt;&gt; J2EE pattern of tying a transaction to an execution thread, even if  
&gt;&gt; multiple
&gt;&gt; data sources are involved, makes sense as it allows to commit/ 
&gt;&gt; rollback
&gt;&gt; multiple things at once. Cayenne Transaction sort of follows that.  
&gt;&gt; JDBC
&gt;&gt; connections within the transaction are scoped by DataNode name. So  
&gt;&gt; what
&gt;&gt; exactly is the problem?
&gt;&gt;
&gt;&gt; Andrus
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; On Dec 1, 2009, at 2:44 PM, Evgeny Ryabitskiy wrote:
&gt;&gt;
&gt;&gt;&gt; Hello 2 everyone!
&gt;&gt;&gt;
&gt;&gt;&gt; Today I one more time thinking about singleton pattern and it's hard
&gt;&gt;&gt; usssage in Cayenne.
&gt;&gt;&gt;
&gt;&gt;&gt; So.. I have several modules, each has own DomainConfig file and
&gt;&gt;&gt; connection to it's DataBase. Sometimes there can be used different  
&gt;&gt;&gt; DB
&gt;&gt;&gt; servers and even different DB types (usually it's Oracle and MS SQL,
&gt;&gt;&gt; sometimes Sybase).
&gt;&gt;&gt;
&gt;&gt;&gt; Singletons:
&gt;&gt;&gt; 1) Configuration.getSharedConfiguration()
&gt;&gt;&gt; This problem is solved:
&gt;&gt;&gt; DefaultConfiguration conf = new
&gt;&gt;&gt; DefaultConfiguration("module1-cayenne.xml");
&gt;&gt;&gt; conf .initialize;
&gt;&gt;&gt; conf.getDomain();
&gt;&gt;&gt; //spend some time to find solution... everywhere examples with
&gt;&gt;&gt; SharedConfiguration
&gt;&gt;&gt;
&gt;&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt;&gt; thread)
&gt;&gt;&gt; //also spend some time
&gt;&gt;&gt;
&gt;&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt;&gt; this is killing one!!!
&gt;&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt;&gt; And that is really huge problem for me.
&gt;&gt;&gt;
&gt;&gt;&gt; So me suggestion is to move this ThreadLocal to DataDomain. Still  
&gt;&gt;&gt; can
&gt;&gt;&gt; use singleton API for standalone applications.
&gt;&gt;&gt; Also we can move DataContext to DataDomain.
&gt;&gt;&gt;
&gt;&gt;&gt; Evgeny.
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [jira] Created: (CAY-1322) Multiple Transactions: Migrate from	Singleton pattern</title>
<author><name>Evgeny Ryabitskiy &lt;evgeny.ryabitskiy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c9f90c2b60912010531s5cf76905vd4016f437388bee3@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9f90c2b60912010531s5cf76905vd4016f437388bee3@mail-gmail-com%3e</id>
<updated>2009-12-01T13:31:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Ok. Maybe I have little bit rushed :)


2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt; I guess that's a bit premature. Let's figure out if there is a problem
&gt; before opening a Jira. "Jiras" are "tasks", i.e. specific action items. So
&gt; I'd rather we come to some consensus on what needs to be done firs, and then
&gt; Jira action items.
&gt;
&gt; Andrus
&gt;
&gt; On Dec 1, 2009, at 2:50 PM, Evgeny Ryabitskiy (JIRA) wrote:
&gt;
&gt;&gt; Multiple Transactions: Migrate from Singleton pattern
&gt;&gt; -----------------------------------------------------
&gt;&gt;
&gt;&gt;                Key: CAY-1322
&gt;&gt;                URL: https://issues.apache.org/jira/browse/CAY-1322
&gt;&gt;            Project: Cayenne
&gt;&gt;         Issue Type: New Feature
&gt;&gt;         Components: Cayenne Core Library
&gt;&gt;           Reporter: Evgeny Ryabitskiy
&gt;&gt;            Fix For: 3.1M1
&gt;&gt;
&gt;&gt;
&gt;&gt; Duplication from Dev-list:
&gt;&gt;
&gt;&gt; So.. I have several modules, each has own DomainConfig file and
&gt;&gt; connection to it's DataBase. Sometimes there can be used different DB
&gt;&gt; servers and even different DB types (usually it's Oracle and MS SQL,
&gt;&gt; sometimes Sybase).
&gt;&gt;
&gt;&gt; Singletons:
&gt;&gt; 1) Configuration.getSharedConfiguration()
&gt;&gt; This problem is solved:
&gt;&gt; DefaultConfiguration conf = new
&gt;&gt; DefaultConfiguration("module1-cayenne.xml");
&gt;&gt; conf .initialize;
&gt;&gt; conf.getDomain();
&gt;&gt; //spend some time to find solution... everywhere examples with
&gt;&gt; SharedConfiguration
&gt;&gt;
&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt; thread)
&gt;&gt; //also spend some time
&gt;&gt;
&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt; this is killing one!!!
&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt; And that is really huge problem for me.
&gt;&gt;
&gt;&gt; So me suggestion is to move this ThreadLocal to DataDomain. Still can
&gt;&gt; use singleton API for standalone applications.
&gt;&gt; Also we can move DataContext to DataDomain.
&gt;&gt;
&gt;&gt; --
&gt;&gt; This message is automatically generated by JIRA.
&gt;&gt; -
&gt;&gt; You can reply to this email to add a comment to the issue online.
&gt;&gt;
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Singletons in Cayenne and problems. Can I use multiple	transactions?</title>
<author><name>Evgeny Ryabitskiy &lt;evgeny.ryabitskiy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-dev/200912.mbox/%3c9f90c2b60912010527v6186ea6fre3d1e9a5c2a67324@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9f90c2b60912010527v6186ea6fre3d1e9a5c2a67324@mail-gmail-com%3e</id>
<updated>2009-12-01T13:27:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Problem in multiple Domains.
When I am creating transaction I am creating it's for specific
DataDomain (like a DataContext).
When I have 2 Modules with dedicated DataDomains (so it will be 2
DataDomains) I can create 2 Transactions
(domain.createTransaction()).

But to thread I can bind only one. Then when I start performing queries I got:
1)First Domain Transaction is binded and handled normally
2)Second Domain Transaction is override by first DataDomain. So when I
perform query for second: ThreadLocals return Transaction for firs
Domain.

Evgeny



2009/12/1 Andrus Adamchik &lt;andrus@objectstyle.org&gt;:
&gt; Singletons are bad in a general purpose framework, like Cayenne. No question
&gt; about that. Per your description even thread-local singletons can be a
&gt; problem, which is less obvious to me, but I guess real in some
&gt; circumstances. So let's see what those are.
&gt;
&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt; thread)
&gt;&gt; //also spend some time
&gt;
&gt; This is just a convenience in Cayenne. Nobody's forced to use it. I will go
&gt; as far as to suggest to remove it from Cayenne 3.1 as a built-in feature,
&gt; and just document it as a possible design pattern in a user application.
&gt;
&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt; this is killing one!!!
&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt; And that is really huge problem for me.
&gt;
&gt; J2EE pattern of tying a transaction to an execution thread, even if multiple
&gt; data sources are involved, makes sense as it allows to commit/rollback
&gt; multiple things at once. Cayenne Transaction sort of follows that. JDBC
&gt; connections within the transaction are scoped by DataNode name. So what
&gt; exactly is the problem?
&gt;
&gt; Andrus
&gt;
&gt;
&gt;
&gt; On Dec 1, 2009, at 2:44 PM, Evgeny Ryabitskiy wrote:
&gt;
&gt;&gt; Hello 2 everyone!
&gt;&gt;
&gt;&gt; Today I one more time thinking about singleton pattern and it's hard
&gt;&gt; usssage in Cayenne.
&gt;&gt;
&gt;&gt; So.. I have several modules, each has own DomainConfig file and
&gt;&gt; connection to it's DataBase. Sometimes there can be used different DB
&gt;&gt; servers and even different DB types (usually it's Oracle and MS SQL,
&gt;&gt; sometimes Sybase).
&gt;&gt;
&gt;&gt; Singletons:
&gt;&gt; 1) Configuration.getSharedConfiguration()
&gt;&gt; This problem is solved:
&gt;&gt; DefaultConfiguration conf = new
&gt;&gt; DefaultConfiguration("module1-cayenne.xml");
&gt;&gt; conf .initialize;
&gt;&gt; conf.getDomain();
&gt;&gt; //spend some time to find solution... everywhere examples with
&gt;&gt; SharedConfiguration
&gt;&gt;
&gt;&gt; 2)DataContext.getThreadLocal()
&gt;&gt; Solved by own ThreadLocal for each module. (modules can work in one
&gt;&gt; thread)
&gt;&gt; //also spend some time
&gt;&gt;
&gt;&gt; 3)Transaction.getThreadTransaction()
&gt;&gt; this is killing one!!!
&gt;&gt; using of own ThreadLocal doesn't help.
&gt;&gt; It's hard-coded in performing Query to use this singleton
&gt;&gt; Transaction.getThreadTransaction()
&gt;&gt; And that is really huge problem for me.
&gt;&gt;
&gt;&gt; So me suggestion is to move this ThreadLocal to DataDomain. Still can
&gt;&gt; use singleton API for standalone applications.
&gt;&gt; Also we can move DataContext to DataDomain.
&gt;&gt;
&gt;&gt; Evgeny.
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
</feed>
