Tadrierion | 1 May 2012 10:11
Picon

Re: Can not load JDBC driver named 'org.apache.derby.jdbc.ClientDriver'

Hi,

I have solved my problem. Thank you very much to have helped me :D

Solution : Add derbyclient.class in "Maven Dependencies".

Thank you very much.

Bye

Axel

--
View this message in context: http://cayenne.195.n3.nabble.com/Can-not-load-JDBC-driver-named-org-apache-derby-jdbc-ClientDriver-tp3950272p3952606.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Andrus Adamchik | 1 May 2012 21:52
Favicon

Re: Can not load JDBC driver named 'org.apache.derby.jdbc.ClientDriver'

Glad to hear you figured it out :)

On May 1, 2012, at 11:11 AM, Tadrierion wrote:

> Hi,
> 
> I have solved my problem. Thank you very much to have helped me :D
> 
> Solution : Add derbyclient.class in "Maven Dependencies".
> 
> Thank you very much.
> 
> Bye
> 
> Axel
> 
> --
> View this message in context: http://cayenne.195.n3.nabble.com/Can-not-load-JDBC-driver-named-org-apache-derby-jdbc-ClientDriver-tp3950272p3952606.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.
> 

Durchholz, Joachim | 2 May 2012 11:11
Picon
Favicon

RE: Standalone app, Threads and Object contexts

> Unfortunately, I may have up to 200 simultaneous requests
> at the database.

Not a problem.

> I'm sure the database administrator won't like to see my
> app opening and closing connections to their database
> so I would prefer to open up a pool of connections and
> then share them among the incoming requests much like a
> web app.

Standalone apps tend to work by opening a single Connection
and using that for all requests.
The snag here is that connections will break sooner or later
(due to networking problems, server restarts, idle time, or
a multitude of other causes), so this needs a library that
recreates a broken connection on the fly.
Connection pooling libraries do that as a side effect. That
means that you use such a library, but not for the pooling
(no need to share connection across "requests", there is no
such thing in a J2SE application unless your design calls
for one due to other reasons) but for the side effect of
recreating connections as needed.

Since I'm still stuck with Hibernate, I can't advise very
well about how to best integrate a connection pooling
library and Cayenne.
I'd probably look up the Cayenne docs on connection pooling,
and just make sure that everything is configured explicitly
that the web container would do for you implicitly.
(Continue reading)

Aristedes Maniatis | 2 May 2012 12:07

Re: Standalone app, Threads and Object contexts

On 2/05/12 7:11pm, Durchholz, Joachim wrote:

> I'd probably look up the Cayenne docs on connection pooling,
> and just make sure that everything is configured explicitly
> that the web container would do for you implicitly.

There is actually nothing at all to do in Cayenne. If you are using tomcat, put your datasource into
conf/server.xml and you are done. Cayenne will simply use the connection pool you define.

http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

Same goes for most other containers.

Ari

--

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

yunus | 2 May 2012 12:29
Picon

Merge operation

Hi,I have a relation Applicant in which all user details are stored.
I want to give user an option of updating his details so i want to know how
to update Applicant relation in cayenne. Its quite similar like MERGE in JPA
where old date has been replaced if any new changes have been made to the
existing one.Now i want to do this in cayenne..
Thanks in advance

--
View this message in context: http://cayenne.195.n3.nabble.com/Merge-operation-tp3954774.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Aristedes Maniatis | 2 May 2012 12:33

Re: Merge operation

If you are talking about something like a modifiedOn date attribute in the object, then look at the Cayenne
listeners for the simplest way to achieve that.

Cheers

Ari

On 2/05/12 8:29pm, yunus wrote:
> Hi,I have a relation Applicant in which all user details are stored.
> I want to give user an option of updating his details so i want to know how
> to update Applicant relation in cayenne. Its quite similar like MERGE in JPA
> where old date has been replaced if any new changes have been made to the
> existing one.Now i want to do this in cayenne..
> Thanks in advance
>
> --
> View this message in context: http://cayenne.195.n3.nabble.com/Merge-operation-tp3954774.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.

--

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

Durchholz, Joachim | 2 May 2012 12:38
Picon
Favicon

RE: Standalone app, Threads and Object contexts

> On 2/05/12 7:11pm, Durchholz, Joachim wrote:
> 
>> I'd probably look up the Cayenne docs on connection pooling, and just 
>> make sure that everything is configured explicitly that the web 
>> container would do for you implicitly.
>
> There is actually nothing at all to do in Cayenne. If you are using
> tomcat, put your datasource into conf/server.xml and you are done.

The Subject says "standalone app".
My understanding is that this implies not having Tomcat or any other J2EE container.

Andrew Willerding | 2 May 2012 15:05

Re: Standalone app, Threads and Object contexts

On 05/02/2012 05:11 AM, Durchholz, Joachim wrote:
> I'd probably look up the Cayenne docs on connection pooling, and just 
> make sure that everything is configured explicitly that the web 
> container would do for you implicitly. BTW I've been working on a J2SE 
> application for the last three years, and it's probably really a good 
> idea to design the application around "requests" or "transactions". 
> Transactions can fail due to transient errors, so you want them 
> restartable, which means you need to wrap them in objects, and there 
> you have your requests. (This pattern also sucks greatly because it 
> isn't easy to pass results back to the caller. Essentially, you're 
> doing the exactly same web service architecture, except it's running 
> inside a single JVM.) 
I got the impression that there was some sort of connection pooling 
built-in to Cayenne because in the Modeller there is a setting for 
minimum and maximum connections.  Now I'm getting confused and perhaps 
I'm using incorrect terminology.

In my mind there is the actual connection to the database as defined 
during the creation of the DataContext.  In the application code I am 
creating an ObjectContext based on the DataContext with a call to 
DataContext.createChildContext().  It is this ObjectContext where I can 
create/delete manipulate the contents of the database.

But in a multi-threaded application do I need to create several 
ObjectContexts or can one ObjectContext be shared among all the 
threads?  If the ObjectContext is sharable then do I need to synchronize 
access to it?  If it needs to by synchronized then the "200th" thread 
will be in a long line-up which is why I would see the need to create 
several pooled ObjectContexts.  But then this takes be back to 
connection pooling as defined in the Modeller.  If everything goes back 
(Continue reading)

Aristedes Maniatis | 2 May 2012 15:29

Re: Standalone app, Threads and Object contexts

On 2/05/12 8:38pm, Durchholz, Joachim wrote:
>> On 2/05/12 7:11pm, Durchholz, Joachim wrote:
>>
>>> I'd probably look up the Cayenne docs on connection pooling, and just
>>> make sure that everything is configured explicitly that the web
>>> container would do for you implicitly.
>>
>> There is actually nothing at all to do in Cayenne. If you are using
>> tomcat, put your datasource into conf/server.xml and you are done.
>
> The Subject says "standalone app".
> My understanding is that this implies not having Tomcat or any other J2EE container.

No idea why that would be implied. But maybe I'm misunderstanding what "standalone" means. Does it mean
Swing? Or a daemon with no UI? Or an application which needs to be a double clickable executable but still
serves web pages? In all three cases, Tomcat/Jetty/etc could still be part of the solution.

I'm a little confused by this email thread because it started off as questions about derby and then morphed
into connection pooling. There are lots of connection pooling libraries out there such as c3po and dbcp.
But I'll step out of this conversation since perhaps I'm not understanding what is being asked.

Ari

--

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

Andrew Willerding | 2 May 2012 15:32

Re: Standalone app, Threads and Object contexts

I'm a little confused by this email thread because it started off as 
questions about derby and then morphed into connection pooling. There 
are lots of connection pooling libraries out there such as c3po and 
dbcp. But I'll step out of this conversation since perhaps I'm not 
understanding what is being asked.
>
> Ari
>
>
My mistake.  I accidentally posted a reply instead of creating a new post.


Gmane