You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Grzegorz Kossakowski <gr...@tuffmail.com> on 2007/07/04 00:01:53 UTC

How to define database connection in C2.2?

Hello,

It's me again. Fortunately enough, it's five minutes to midnight so this is going to be my last e-mail this day. ;)

I'm wondering now how to define database connection in C2.2 so it is available easily in all Cocoon components and my own Spring beans. Do 
we have an replacement for patching cocoon.xconf that is already gone?

I hope that someone helps me to sort out this (and, maybe, other upcoming) issue. I'm going to prepare small surprise ;)

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

RE: How to define database connection in C2.2?

Posted by Jeroen Reijn <j....@hippo.nl>.
Grzegorz,
 
thanks for the pointer. I'll have a look tonight and see if I can make a start.
 
Greetz,
 
Jeroen Reijn

	-----Oorspronkelijk bericht----- 
	Van: Grzegorz Kossakowski [mailto:gkossakowski@apache.org] 
	Verzonden: wo 4-7-2007 14:40 
	Aan: dev@cocoon.apache.org 
	CC: 
	Onderwerp: Re: How to define database connection in C2.2?
	
	

	Jeroen Reijn pisze:
	> I've been going through some db and forms samples over the past couple of days and I'm happy to help out in the little time I have during
	> the week. I'll be very busy from next week on, but I can probably lend a hand this week.
	>
	> Is there some working/migrated example somewhere in 2.2 that I can take a look at before I start migrating a sample?
	
	Unfortunately I think you will have to take a role of pioneer. I have not seen any code using Spring's DriverManagerDataSource bean.
	Nevertheless, I don't think that you will have to put a lot of effort to figure out how set up things.
	
	--
	Grzegorz Kossakowski
	http://reflectingonthevicissitudes.wordpress.com/
	


Re: How to define database connection in C2.2?

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Jeroen Reijn pisze:
> I've been going through some db and forms samples over the past couple of days and I'm happy to help out in the little time I have during
> the week. I'll be very busy from next week on, but I can probably lend a hand this week.
> 
> Is there some working/migrated example somewhere in 2.2 that I can take a look at before I start migrating a sample?

Unfortunately I think you will have to take a role of pioneer. I have not seen any code using Spring's DriverManagerDataSource bean. 
Nevertheless, I don't think that you will have to put a lot of effort to figure out how set up things.

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

RE: How to define database connection in C2.2?

Posted by Jeroen Reijn <j....@hippo.nl>.
I've been going through some db and forms samples over the past couple of days and I'm happy to help out in the little time I have during the week. I'll be very busy from next week on, but I can probably lend a hand this week.
 
Is there some working/migrated example somewhere in 2.2 that I can take a look at before I start migrating a sample?
 
Regards,
 
Jeroen Reijn

	-----Oorspronkelijk bericht----- 
	Van: Grzegorz Kossakowski [mailto:gkossakowski@apache.org] 
	Verzonden: wo 4-7-2007 13:37 
	Aan: dev@cocoon.apache.org 
	CC: 
	Onderwerp: Re: How to define database connection in C2.2?
	
	

	Felix Knecht pisze:
	>
	> I see the point, but wouldn't this give a wrong idea to new c22 users on
	> how to do it? Wouldn't it be better to put our efforts in migrating the
	> samples?
	
	Yes, I agree that we should migrate samples ASAP but what about all components? Migrating them all is not one day task.
	
	--
	Grzegorz Kossakowski
	http://reflectingonthevicissitudes.wordpress.com/
	


Re: How to define database connection in C2.2?

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Felix Knecht pisze:
> 
> I see the point, but wouldn't this give a wrong idea to new c22 users on
> how to do it? Wouldn't it be better to put our efforts in migrating the
> samples?

Yes, I agree that we should migrate samples ASAP but what about all components? Migrating them all is not one day task.

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Re: How to define database connection in C2.2?

Posted by Felix Knecht <fe...@apache.org>.
Grzegorz Kossakowski schrieb:
> Felix Knecht pisze:
>>
>> Do you think its worth to write such a bridge? Avalon is dead
>> (http://avalon.apache.org/closed.html) and c22 is now spring based.
>> Wouldn't it be a better solution migrate the db-stuff to spring and
>> therefore force the user to migrate his own components as well? In c22 a
>> lot has changed (e.g. forms). An c21 'block' will not run anyway just
>> putting it into c22. Adaptions need to be done.
>
> I don't want to support dead Avalon, I want to support Cocoon's
> components that still depend on Avalon and its DataSource managment. I
> know that blocks from C2.1 will not work in C2.2 but we have
> components in C2.2 (like SQLTransformer) that still obtain sql
> connection through DataSource interfaces. I have not done in-depth
> analysis but my rough guess is that _all_ samples in C2.2 that need
> database access still depend on old approach.
>
> If writing such a bridge would be quite easy I think its worth the
> effort to make all samples and components working again right away.
>

I see the point, but wouldn't this give a wrong idea to new c22 users on
how to do it? Wouldn't it be better to put our efforts in migrating the
samples?
WDYT?

Re: How to define database connection in C2.2?

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Felix Knecht pisze:
> 
> Do you think its worth to write such a bridge? Avalon is dead
> (http://avalon.apache.org/closed.html) and c22 is now spring based.
> Wouldn't it be a better solution migrate the db-stuff to spring and
> therefore force the user to migrate his own components as well? In c22 a
> lot has changed (e.g. forms). An c21 'block' will not run anyway just
> putting it into c22. Adaptions need to be done.

I don't want to support dead Avalon, I want to support Cocoon's components that still depend on Avalon and its DataSource managment. I know 
that blocks from C2.1 will not work in C2.2 but we have components in C2.2 (like SQLTransformer) that still obtain sql connection through 
DataSource interfaces. I have not done in-depth analysis but my rough guess is that _all_ samples in C2.2 that need database access still 
depend on old approach.

If writing such a bridge would be quite easy I think its worth the effort to make all samples and components working again right away.

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Re: How to define database connection in C2.2?

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Felix Knecht pisze:
> 
> Do you think its worth to write such a bridge? Avalon is dead
> (http://avalon.apache.org/closed.html) and c22 is now spring based.
> Wouldn't it be a better solution migrate the db-stuff to spring and
> therefore force the user to migrate his own components as well? In c22 a
> lot has changed (e.g. forms). An c21 'block' will not run anyway just
> putting it into c22. Adaptions need to be done.

It was quite easy to write such a bridge, see my commit r553872. I must admit that I wasn't able to test it thoroughly, though.

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Re: How to define database connection in C2.2?

Posted by Felix Knecht <fe...@apache.org>.
> Then it would be very inconvenient to define data source both for
> Avalon components and Spring beans, I'm thinking about writing some
> bridge that would allow Avalon components use connections defined in
> Spring way.
>
> Do you have any ideas where to start while implementing such
> functionality? Generally speaking, is it possible to write such bridge?

Do you think its worth to write such a bridge? Avalon is dead
(http://avalon.apache.org/closed.html) and c22 is now spring based.
Wouldn't it be a better solution migrate the db-stuff to spring and
therefore force the user to migrate his own components as well? In c22 a
lot has changed (e.g. forms). An c21 'block' will not run anyway just
putting it into c22. Adaptions need to be done.

Felix


Re: How to define database connection in C2.2?

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Giacomo Pati pisze:
> 
> Of course not. Avalon Components usually depend on DataSourceComponent,
> which is an Excalibur class and in no way compatible with standard javax.sql.DataSource class.

Then it would be very inconvenient to define data source both for Avalon components and Spring beans, I'm thinking about writing some bridge 
that would allow Avalon components use connections defined in Spring way.

Do you have any ideas where to start while implementing such functionality? Generally speaking, is it possible to write such bridge?

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Re: How to define database connection in C2.2?

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Grzegorz Kossakowski wrote:
> Giacomo Pati pisze:
>> On Wed, 4 Jul 2007, Grzegorz Kossakowski wrote:
>>
>>> Date: Wed, 04 Jul 2007 00:01:53 +0200
>>> From: Grzegorz Kossakowski <gr...@tuffmail.com>
>>> Reply-To: dev@cocoon.apache.org
>>> To: Cocoon's dev mailing list <de...@cocoon.apache.org>
>>> Subject: How to define database connection in C2.2?
>>>
>>> Hello,
>>>
>>> It's me again. Fortunately enough, it's five minutes to midnight so
>>> this is going to be my last e-mail this day. ;)
>>>
>>> I'm wondering now how to define database connection in C2.2 so it is
>>> available easily in all Cocoon components and my own Spring beans. Do
>>> we have an replacement for patching cocoon.xconf that is already gone?
>>
>> Just go the Spring way of defining a DataSource and we probably can
>> forget about the way it was with 2.1 Excalibur DataSources.
> 
> The crucial question is if components working with Excalibur DataSources
> will be able to use Spring-defined DataSources? Do we have similar
> bridge to the one that allows us to obtain Spring bean through Avalon's
> Service Manager?

Of course not. Avalon Components usually depend on DataSourceComponent,
which is an Excalibur class and in no way compatible with standard javax.sql.DataSource class.

> 
> (If no one knows I'll try to figure it out myself)

- --
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (GNU/Linux)

iD8DBQFGi209LNdJvZjjVZARAgWmAJ929JYFR0p4S6SDZ4fvT7EaEf3MBQCgkAzw
PSqLuWNf9MbnXlahni5Cgas=
=sJxa
-----END PGP SIGNATURE-----

Re: How to define database connection in C2.2?

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Giacomo Pati pisze:
> On Wed, 4 Jul 2007, Grzegorz Kossakowski wrote:
> 
>> Date: Wed, 04 Jul 2007 00:01:53 +0200
>> From: Grzegorz Kossakowski <gr...@tuffmail.com>
>> Reply-To: dev@cocoon.apache.org
>> To: Cocoon's dev mailing list <de...@cocoon.apache.org>
>> Subject: How to define database connection in C2.2?
>>
>> Hello,
>>
>> It's me again. Fortunately enough, it's five minutes to midnight so 
>> this is going to be my last e-mail this day. ;)
>>
>> I'm wondering now how to define database connection in C2.2 so it is 
>> available easily in all Cocoon components and my own Spring beans. Do 
>> we have an replacement for patching cocoon.xconf that is already gone?
> 
> Just go the Spring way of defining a DataSource and we probably can 
> forget about the way it was with 2.1 Excalibur DataSources.

The crucial question is if components working with Excalibur DataSources will be able to use Spring-defined DataSources? Do we have similar 
bridge to the one that allows us to obtain Spring bean through Avalon's Service Manager?

(If no one knows I'll try to figure it out myself)

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Re: How to define database connection in C2.2?

Posted by Giacomo Pati <gi...@otego.com>.
On Wed, 4 Jul 2007, Grzegorz Kossakowski wrote:

> Date: Wed, 04 Jul 2007 00:01:53 +0200
> From: Grzegorz Kossakowski <gr...@tuffmail.com>
> Reply-To: dev@cocoon.apache.org
> To: Cocoon's dev mailing list <de...@cocoon.apache.org>
> Subject: How to define database connection in C2.2?
> 
> Hello,
>
> It's me again. Fortunately enough, it's five minutes to midnight so this is 
> going to be my last e-mail this day. ;)
>
> I'm wondering now how to define database connection in C2.2 so it is 
> available easily in all Cocoon components and my own Spring beans. Do we have 
> an replacement for patching cocoon.xconf that is already gone?

Just go the Spring way of defining a DataSource and we probably can forget 
about the way it was with 2.1 Excalibur DataSources.

Ciao

>
> I hope that someone helps me to sort out this (and, maybe, other upcoming) 
> issue. I'm going to prepare small surprise ;)
>
>

-- 
Otego AG                                  Tel:   +41 (0)1  240 00 55
Giacomo Pati, CTO                         Mobile:+41 (0)79 262 21 04
Apache Software Foundation Member         Mailto:giacomo@apache.org
Hohlstrasse 216                           Mailto:Giacomo.Pati@otego.com
CH-8004 Zürich                            http://www.otego.com