Trails and multiple databases

View: New views
13 Messages — Rating Filter:   Alert me  

Trails and multiple databases

by Pablo Gra\~na :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there.

Is it possible to have multiple databases in trails? This implies having
muiltiple session factories and a way of associating a session factory
to an entity.

Thanks a lot.

--
Pablo Gra\~na
Chief Architect
Globant
Arg Office: +54 (11) 4109 1743
UK  Office: +44 (20) 7043 8269 int 8043
US  Office: +1 (212) 400 7686 int 8043


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Trails and multiple databases

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Pablo

I don't think this is possible on Trails 1.1.1, because we
"over-abused" the @Inject(value="spring:whatever") annotation.
I took special care to avoid this issue on Trails 1.2.
Implementing this on Trails 1.2 will require two  session factories,
two open session filters, two persistence services and two hibernate
annotations decorators. BUT I'm not completely sure since I haven't
tried it (yet).

May I ask why do you need two databases?
Could two different applications and a single sign on solve your problems?

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es

On Dec 1, 2007 11:15 AM, Pablo Gra~na <pablo.grana@...> wrote:

> Hi there.
>
> Is it possible to have multiple databases in trails? This implies having
> muiltiple session factories and a way of associating a session factory
> to an entity.
>
> Thanks a lot.
>
> --
> Pablo Gra\~na
> Chief Architect
> Globant
> Arg Office: +54 (11) 4109 1743
> UK  Office: +44 (20) 7043 8269 int 8043
> US  Office: +1 (212) 400 7686 int 8043
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Trails and multiple databases

by PabloS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is it really necessary to have two SessionFactories? (that would imply two diferent Configuration objects).

What's the actual requirement? Spring has ways to let you chose datasource dinamically...

Regards,
Pablo S.

On 04/12/2007, Alejandro Scandroli <alejandroscandroli@...> wrote:
Hi Pablo

I don't think this is possible on Trails 1.1.1, because we
"over-abused" the @Inject(value="spring:whatever") annotation.
I took special care to avoid this issue on Trails 1.2 .
Implementing this on Trails 1.2 will require two  session factories,
two open session filters, two persistence services and two hibernate
annotations decorators. BUT I'm not completely sure since I haven't
tried it (yet).

May I ask why do you need two databases?
Could two different applications and a single sign on solve your problems?

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es

On Dec 1, 2007 11:15 AM, Pablo Gra~na <pablo.grana@...> wrote:

> Hi there.
>
> Is it possible to have multiple databases in trails? This implies having
> muiltiple session factories and a way of associating a session factory
> to an entity.
>
> Thanks a lot.
>
> --
> Pablo Gra\~na
> Chief Architect
> Globant
> Arg Office: +54 (11) 4109 1743
> UK  Office: +44 (20) 7043 8269 int 8043
> US  Office: +1 (212) 400 7686 int 8043
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email



Localization of ObjectTable column headings

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was trying to follow:

http://www.trailsframework.org/Localization

and entered the following properties:

trails_en.properties

com.package.dao.Clip.clipTitle= Title


trails_de.properties


clipid = Clip ID

and

com.package.dao.Clip.clipTitle = Titel


but the ObjectTable will display "CLIP TITLE"

What am I doing wrong?

Thanks!

Toby

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Trails and multiple databases

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Database "Load-Balancing"

Some websites with heavy load use a one-way database replication.
So you read from one database (pool) but always write to a different database which will replicate to all other databases. On many websites 99% of all queries are select-queries and the updates/inserts block the tables. So you are faster this way.

Transcational databases

Sometimes people exchange data using a database instead of SOAP. This database is usally a transcational database in between your own database and the third party database - this way you do not have to expose your own database to others.

Imagine you want to add a discussion board to your website and instead of developing your own, you just use JavaBB/phpBB. In that case you would probably want to keep this data isolated from the rest of your application.

-------- Original-Nachricht --------
> Datum: Tue, 4 Dec 2007 10:46:24 -0300
> Von: "Pablo Saavedra" <pablo.a.saavedra@...>
> An: users@...
> Betreff: Re: [trails-users] Trails and multiple databases

> Is it really necessary to have two SessionFactories? (that would imply two
> diferent Configuration objects).
>
> What's the actual requirement? Spring has ways to let you chose datasource
> dinamically...
>
> Regards,
> Pablo S.
>
> On 04/12/2007, Alejandro Scandroli <alejandroscandroli@...> wrote:
> >
> > Hi Pablo
> >
> > I don't think this is possible on Trails 1.1.1, because we
> > "over-abused" the @Inject(value="spring:whatever") annotation.
> > I took special care to avoid this issue on Trails 1.2.
> > Implementing this on Trails 1.2 will require two  session factories,
> > two open session filters, two persistence services and two hibernate
> > annotations decorators. BUT I'm not completely sure since I haven't
> > tried it (yet).
> >
> > May I ask why do you need two databases?
> > Could two different applications and a single sign on solve your
> problems?
> >
> > --
> > Alejandro Scandroli
> > Amneris: We build process-driven web applications.
> > http://www.amneris.es
> >
> > On Dec 1, 2007 11:15 AM, Pablo Gra~na <pablo.grana@...> wrote:
> > > Hi there.
> > >
> > > Is it possible to have multiple databases in trails? This implies
> having
> > > muiltiple session factories and a way of associating a session factory
> > > to an entity.
> > >
> > > Thanks a lot.
> > >
> > > --
> > > Pablo Gra\~na
> > > Chief Architect
> > > Globant
> > > Arg Office: +54 (11) 4109 1743
> > > UK  Office: +44 (20) 7043 8269 int 8043
> > > US  Office: +1 (212) 400 7686 int 8043
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe from this list please visit:
> > >
> > >     http://xircles.codehaus.org/manage_email
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Localization of ObjectTable column headings

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tobias,

You should add German locale to the accepted locales list in the
trails.application file.

<meta key="org.apache.tapestry.accepted-locales" value="de,en,es_AR,pt"/>

BTW, I recommend you to remove the languages you are not going to support.

If it works, can you add this information to the wiki page, please?

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es


On Dec 4, 2007 3:23 PM,  <superoverdrive@...> wrote:

> I was trying to follow:
>
> http://www.trailsframework.org/Localization
>
> and entered the following properties:
>
> trails_en.properties
>
> com.package.dao.Clip.clipTitle= Title
>
>
> trails_de.properties
>
>
> clipid = Clip ID
>
> and
>
> com.package.dao.Clip.clipTitle = Titel
>
>
> but the ObjectTable will display "CLIP TITLE"
>
> What am I doing wrong?
>
> Thanks!
>
> Toby
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Localization of ObjectTable column headings

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, I can add it.

I have already had "en" listed in the locales. So at least the column header of the ObjectTable should have been correct for the English heading. I have added "de" now, too.

Trails displays things such as "German Film Title" as the property is germanFilmTitle.

It will not "pick up" the alternative Property from the trails_en.properties.

com.package.dao.Clip.englishClipTitle = Clip Title
englishFilmTitle = Film Title

Neither the fully package name nor the property name works.

-------- Original-Nachricht --------
> Datum: Tue, 4 Dec 2007 16:05:20 +0100
> Von: "Alejandro Scandroli" <alejandroscandroli@...>
> An: users@...
> Betreff: Re: [trails-users] Localization of ObjectTable column headings

> Hi Tobias,
>
> You should add German locale to the accepted locales list in the
> trails.application file.
>
> <meta key="org.apache.tapestry.accepted-locales" value="de,en,es_AR,pt"/>
>
> BTW, I recommend you to remove the languages you are not going to support.
>
> If it works, can you add this information to the wiki page, please?
>
> --
> Alejandro Scandroli
> Amneris: We build process-driven web applications.
> http://www.amneris.es
>
>
> On Dec 4, 2007 3:23 PM,  <superoverdrive@...> wrote:
> > I was trying to follow:
> >
> > http://www.trailsframework.org/Localization
> >
> > and entered the following properties:
> >
> > trails_en.properties
> >
> > com.package.dao.Clip.clipTitle= Title
> >
> >
> > trails_de.properties
> >
> >
> > clipid = Clip ID
> >
> > and
> >
> > com.package.dao.Clip.clipTitle = Titel
> >
> >
> > but the ObjectTable will display "CLIP TITLE"
> >
> > What am I doing wrong?
> >
> > Thanks!
> >
> > Toby
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Localization of ObjectTable column headings

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ohh sorry,
for POJO properties the file you have to edit is
src/main/resources/messages_de.properties


--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es


On Dec 4, 2007 4:17 PM, Tobias Marx <superoverdrive@...> wrote:

> Ok, I can add it.
>
> I have already had "en" listed in the locales. So at least the column header of the ObjectTable should have been correct for the English heading. I have added "de" now, too.
>
> Trails displays things such as "German Film Title" as the property is germanFilmTitle.
>
> It will not "pick up" the alternative Property from the trails_en.properties.
>
> com.package.dao.Clip.englishClipTitle = Clip Title
> englishFilmTitle = Film Title
>
> Neither the fully package name nor the property name works.
>
> -------- Original-Nachricht --------
> > Datum: Tue, 4 Dec 2007 16:05:20 +0100
> > Von: "Alejandro Scandroli" <alejandroscandroli@...>
> > An: users@...
> > Betreff: Re: [trails-users] Localization of ObjectTable column headings
>
>
> > Hi Tobias,
> >
> > You should add German locale to the accepted locales list in the
> > trails.application file.
> >
> > <meta key="org.apache.tapestry.accepted-locales" value="de,en,es_AR,pt"/>
> >
> > BTW, I recommend you to remove the languages you are not going to support.
> >
> > If it works, can you add this information to the wiki page, please?
> >
> > --
> > Alejandro Scandroli
> > Amneris: We build process-driven web applications.
> > http://www.amneris.es
> >
> >
> > On Dec 4, 2007 3:23 PM,  <superoverdrive@...> wrote:
> > > I was trying to follow:
> > >
> > > http://www.trailsframework.org/Localization
> > >
> > > and entered the following properties:
> > >
> > > trails_en.properties
> > >
> > > com.package.dao.Clip.clipTitle= Title
> > >
> > >
> > > trails_de.properties
> > >
> > >
> > > clipid = Clip ID
> > >
> > > and
> > >
> > > com.package.dao.Clip.clipTitle = Titel
> > >
> > >
> > > but the ObjectTable will display "CLIP TITLE"
> > >
> > > What am I doing wrong?
> > >
> > > Thanks!
> > >
> > > Toby
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe from this list please visit:
> > >
> > >     http://xircles.codehaus.org/manage_email
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Trails and multiple databases

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Sorry, I (wrongly?) understood "multiple databases" as "multiple models".
Pablo, If what you want is multiple databases using the same model,
you just need to provide a DelegatingDataSource implementation to the
sessionFactory.


--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es


On Dec 4, 2007 3:40 PM,  <superoverdrive@...> wrote:

> Database "Load-Balancing"
>
> Some websites with heavy load use a one-way database replication.
> So you read from one database (pool) but always write to a different database which will replicate to all other databases. On many websites 99% of all queries are select-queries and the updates/inserts block the tables. So you are faster this way.
>
> Transcational databases
>
> Sometimes people exchange data using a database instead of SOAP. This database is usally a transcational database in between your own database and the third party database - this way you do not have to expose your own database to others.
>
> Imagine you want to add a discussion board to your website and instead of developing your own, you just use JavaBB/phpBB. In that case you would probably want to keep this data isolated from the rest of your application.
>
> -------- Original-Nachricht --------
> > Datum: Tue, 4 Dec 2007 10:46:24 -0300
> > Von: "Pablo Saavedra" <pablo.a.saavedra@...>
> > An: users@...
> > Betreff: Re: [trails-users] Trails and multiple databases
>
>
> > Is it really necessary to have two SessionFactories? (that would imply two
> > diferent Configuration objects).
> >
> > What's the actual requirement? Spring has ways to let you chose datasource
> > dinamically...
> >
> > Regards,
> > Pablo S.
> >
> > On 04/12/2007, Alejandro Scandroli <alejandroscandroli@...> wrote:
> > >
> > > Hi Pablo
> > >
> > > I don't think this is possible on Trails 1.1.1, because we
> > > "over-abused" the @Inject(value="spring:whatever") annotation.
> > > I took special care to avoid this issue on Trails 1.2.
> > > Implementing this on Trails 1.2 will require two  session factories,
> > > two open session filters, two persistence services and two hibernate
> > > annotations decorators. BUT I'm not completely sure since I haven't
> > > tried it (yet).
> > >
> > > May I ask why do you need two databases?
> > > Could two different applications and a single sign on solve your
> > problems?
> > >
> > > --
> > > Alejandro Scandroli
> > > Amneris: We build process-driven web applications.
> > > http://www.amneris.es
> > >
> > > On Dec 1, 2007 11:15 AM, Pablo Gra~na <pablo.grana@...> wrote:
> > > > Hi there.
> > > >
> > > > Is it possible to have multiple databases in trails? This implies
> > having
> > > > muiltiple session factories and a way of associating a session factory
> > > > to an entity.
> > > >
> > > > Thanks a lot.
> > > >
> > > > --
> > > > Pablo Gra\~na
> > > > Chief Architect
> > > > Globant
> > > > Arg Office: +54 (11) 4109 1743
> > > > UK  Office: +44 (20) 7043 8269 int 8043
> > > > US  Office: +1 (212) 400 7686 int 8043
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe from this list please visit:
> > > >
> > > >     http://xircles.codehaus.org/manage_email
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe from this list please visit:
> > >
> > >     http://xircles.codehaus.org/manage_email
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Multiple ObjectTables per page -> Multiple references to embedded component...

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I managed to use several ObjectTables on the same page.

However, if the ObjectTables happen to use Objects with the same column name, e.g. when you want to overwrite a column such as here:

 <features jwcid="features@Block">
    <h1>Features</h1>
   
       <table class="table contribTable" jwcid="b@ObjectTable"
                 rowsClass="ognl:beans.evenOdd.next"
                 instances="ognl:features"
                 object="ognl:object"
                 column="ognl:column">
                 
                <div jwcid="previewVideoColumnValue@Block">
            <if jwcid="@If" condition="ognl:object.download">
            <input type="submit" value="download"/>
            </if>
            <else jwcid="@Else">
            <span jwcid="@Insert" value="message:downloadNotAvailable"/>
            </else>
            </div>

                 
                </table>
       
  </features>

  <shorts jwcid="shorts@Block">
    <h1>Shorts</h1>
   
           <table class="table contribTable" jwcid="a@ObjectTable"
                 rowsClass="ognl:beans.evenOdd.next"
                 instances="ognl:shorts"
                 object="ognl:object"
                 column="ognl:column">
                 
                 <div jwcid="previewVideoColumnValue@Block">
            <if jwcid="@If" condition="ognl:object.download">
            <input type="submit" value="download"/>
            </if>
            <else jwcid="@Else">
            <span jwcid="@Insert" value="message:downloadNotAvailable"/>
            </else>
            </div>
                 
         </table>
   
  </shorts>


This leads to a problem:

"Template for component Search contains multiple references to embedded component previewVideoColumnValue." - although it is 2 different tables!

I would of course find a solution that does not mean renaming my class methods....

Is that a bug in ObjectTable is there an error in its usage?

Thanks!

Toby


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Multiple ObjectTables per page -> Multiple references to embedded component...

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tobias,

This is a mix between a Tapestry limitation and a Trails bug. I had
the same problem using multiple Tapestry Contrib Table component
instances in the same page.
The limitation is that in Tapestry you can't have two components with
the same name. The bug is that Trails is looking for block components
in the "Page" when it should be looking in the "Container" first. This
bug has been fixed in Trails 1.2.

The solution: If your block's template code is the same (line by line)
you can use only one block.
Put your block outside the ObjectTable component, like this:

    <div jwcid="previewVideoColumnValue@Block">
        <if jwcid="@If" condition="ognl:object.download">
            <input type="submit" value="download"/>
        </if>
        <else jwcid="@Else">
            <span jwcid="@Insert" value="message:downloadNotAvailable"/>
        </else>
    </div>

<features jwcid="features@Block">
   <h1>Features</h1>

      <table class="table contribTable" jwcid="b@ObjectTable"
                rowsClass="ognl:beans.evenOdd.next"
                instances="ognl:features"
                object="ognl:object"
                column="ognl:column"
                persist="literal:client:page">
       </table>

 </features>

 <shorts jwcid="shorts@Block">
   <h1>Shorts</h1>

          <table class="table contribTable" jwcid="a@ObjectTable"
                rowsClass="ognl:beans.evenOdd.next"
                instances="ognl:shorts"
                object="ognl:object"
                column="ognl:column"
                persist="literal:client:page">
        </table>

 </shorts>

BTW, when using multiple tables in the same page is highly recommended
to persist the tables's internal state in the client:
persist="literal:client:page" , specially if the tables share the same
TableColumnModel.

I hope it helps.

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es


On Dec 6, 2007 4:48 PM,  <superoverdrive@...> wrote:

> I managed to use several ObjectTables on the same page.
>
> However, if the ObjectTables happen to use Objects with the same column name, e.g. when you want to overwrite a column such as here:
>
>  <features jwcid="features@Block">
>     <h1>Features</h1>
>
>        <table class="table contribTable" jwcid="b@ObjectTable"
>                  rowsClass="ognl:beans.evenOdd.next"
>                  instances="ognl:features"
>                  object="ognl:object"
>                  column="ognl:column">
>
>                 <div jwcid="previewVideoColumnValue@Block">
>                  <if jwcid="@If" condition="ognl:object.download">
>                         <input type="submit" value="download"/>
>                  </if>
>                  <else jwcid="@Else">
>                         <span jwcid="@Insert" value="message:downloadNotAvailable"/>
>                  </else>
>                 </div>
>
>
>                 </table>
>
>   </features>
>
>   <shorts jwcid="shorts@Block">
>     <h1>Shorts</h1>
>
>            <table class="table contribTable" jwcid="a@ObjectTable"
>                  rowsClass="ognl:beans.evenOdd.next"
>                  instances="ognl:shorts"
>                  object="ognl:object"
>                  column="ognl:column">
>
>                  <div jwcid="previewVideoColumnValue@Block">
>                  <if jwcid="@If" condition="ognl:object.download">
>                         <input type="submit" value="download"/>
>                  </if>
>                  <else jwcid="@Else">
>                         <span jwcid="@Insert" value="message:downloadNotAvailable"/>
>                  </else>
>                 </div>
>
>          </table>
>
>   </shorts>
>
>
> This leads to a problem:
>
> "Template for component Search contains multiple references to embedded component previewVideoColumnValue." - although it is 2 different tables!
>
> I would of course find a solution that does not mean renaming my class methods....
>
> Is that a bug in ObjectTable is there an error in its usage?
>
> Thanks!
>
> Toby
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Trails and multiple databases

by Pablo Gra\~na :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, alejandro.

You got it right the first time.

The idea is to have multiple models, each with its own database. We have
solved it using multiple wars and cas as a single sign on.

So I'll have to wait till version 1.2. How far are we from it?

thanks a lot

Alejandro Scandroli wrote:

> Hi
>
> Sorry, I (wrongly?) understood "multiple databases" as "multiple models".
> Pablo, If what you want is multiple databases using the same model,
> you just need to provide a DelegatingDataSource implementation to the
> sessionFactory.
>
>
> --
> Alejandro Scandroli
> Amneris: We build process-driven web applications.
> http://www.amneris.es
>
>
> On Dec 4, 2007 3:40 PM,  <superoverdrive@...> wrote:
>> Database "Load-Balancing"
>>
>> Some websites with heavy load use a one-way database replication.
>> So you read from one database (pool) but always write to a different database which will replicate to all other databases. On many websites 99% of all queries are select-queries and the updates/inserts block the tables. So you are faster this way.
>>
>> Transcational databases
>>
>> Sometimes people exchange data using a database instead of SOAP. This database is usally a transcational database in between your own database and the third party database - this way you do not have to expose your own database to others.
>>
>> Imagine you want to add a discussion board to your website and instead of developing your own, you just use JavaBB/phpBB. In that case you would probably want to keep this data isolated from the rest of your application.
>>
>> -------- Original-Nachricht --------
>>> Datum: Tue, 4 Dec 2007 10:46:24 -0300
>>> Von: "Pablo Saavedra" <pablo.a.saavedra@...>
>>> An: users@...
>>> Betreff: Re: [trails-users] Trails and multiple databases
>>
>>> Is it really necessary to have two SessionFactories? (that would imply two
>>> diferent Configuration objects).
>>>
>>> What's the actual requirement? Spring has ways to let you chose datasource
>>> dinamically...
>>>
>>> Regards,
>>> Pablo S.
>>>
>>> On 04/12/2007, Alejandro Scandroli <alejandroscandroli@...> wrote:
>>>> Hi Pablo
>>>>
>>>> I don't think this is possible on Trails 1.1.1, because we
>>>> "over-abused" the @Inject(value="spring:whatever") annotation.
>>>> I took special care to avoid this issue on Trails 1.2.
>>>> Implementing this on Trails 1.2 will require two  session factories,
>>>> two open session filters, two persistence services and two hibernate
>>>> annotations decorators. BUT I'm not completely sure since I haven't
>>>> tried it (yet).
>>>>
>>>> May I ask why do you need two databases?
>>>> Could two different applications and a single sign on solve your
>>> problems?
>>>> --
>>>> Alejandro Scandroli
>>>> Amneris: We build process-driven web applications.
>>>> http://www.amneris.es
>>>>
>>>> On Dec 1, 2007 11:15 AM, Pablo Gra~na <pablo.grana@...> wrote:
>>>>> Hi there.
>>>>>
>>>>> Is it possible to have multiple databases in trails? This implies
>>> having
>>>>> muiltiple session factories and a way of associating a session factory
>>>>> to an entity.
>>>>>
>>>>> Thanks a lot.
>>>>>
>>>>> --
>>>>> Pablo Gra\~na
>>>>> Chief Architect
>>>>> Globant
>>>>> Arg Office: +54 (11) 4109 1743
>>>>> UK  Office: +44 (20) 7043 8269 int 8043
>>>>> US  Office: +1 (212) 400 7686 int 8043
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe from this list please visit:
>>>>>
>>>>>     http://xircles.codehaus.org/manage_email
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list please visit:
>>>>
>>>>     http://xircles.codehaus.org/manage_email
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>

--
Pablo Gra\~na
Chief Architect
Globant
Arg Office: +54 (11) 4109 1743
UK  Office: +44 (20) 7043 8269 int 8043
US  Office: +1 (212) 400 7686 int 8043


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Trails and multiple databases

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Pablo

I think two different applications with an SSO is a superior solution,
you should stick to it.
On a related note I recently joined ProdigyFish's CasIdentity
(http://code.google.com/p/casidentity/) project and I plan to make it
compatible with Trails.

I will write about Trails 1.2 in a few minutes.

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es


On Dec 6, 2007 8:21 PM, Pablo Gra~na <pablo.grana@...> wrote:

> Hi, alejandro.
>
> You got it right the first time.
>
> The idea is to have multiple models, each with its own database. We have
> solved it using multiple wars and cas as a single sign on.
>
> So I'll have to wait till version 1.2. How far are we from it?
>
> thanks a lot
>
>
> Alejandro Scandroli wrote:
> > Hi
> >
> > Sorry, I (wrongly?) understood "multiple databases" as "multiple models".
> > Pablo, If what you want is multiple databases using the same model,
> > you just need to provide a DelegatingDataSource implementation to the
> > sessionFactory.
> >
> >
> > --
> > Alejandro Scandroli
> > Amneris: We build process-driven web applications.
> > http://www.amneris.es
> >
> >
> > On Dec 4, 2007 3:40 PM,  <superoverdrive@...> wrote:
> >> Database "Load-Balancing"
> >>
> >> Some websites with heavy load use a one-way database replication.
> >> So you read from one database (pool) but always write to a different database which will replicate to all other databases. On many websites 99% of all queries are select-queries and the updates/inserts block the tables. So you are faster this way.
> >>
> >> Transcational databases
> >>
> >> Sometimes people exchange data using a database instead of SOAP. This database is usally a transcational database in between your own database and the third party database - this way you do not have to expose your own database to others.
> >>
> >> Imagine you want to add a discussion board to your website and instead of developing your own, you just use JavaBB/phpBB. In that case you would probably want to keep this data isolated from the rest of your application.
> >>
> >> -------- Original-Nachricht --------
> >>> Datum: Tue, 4 Dec 2007 10:46:24 -0300
> >>> Von: "Pablo Saavedra" <pablo.a.saavedra@...>
> >>> An: users@...
> >>> Betreff: Re: [trails-users] Trails and multiple databases
> >>
> >>> Is it really necessary to have two SessionFactories? (that would imply two
> >>> diferent Configuration objects).
> >>>
> >>> What's the actual requirement? Spring has ways to let you chose datasource
> >>> dinamically...
> >>>
> >>> Regards,
> >>> Pablo S.
> >>>
> >>> On 04/12/2007, Alejandro Scandroli <alejandroscandroli@...> wrote:
> >>>> Hi Pablo
> >>>>
> >>>> I don't think this is possible on Trails 1.1.1, because we
> >>>> "over-abused" the @Inject(value="spring:whatever") annotation.
> >>>> I took special care to avoid this issue on Trails 1.2.
> >>>> Implementing this on Trails 1.2 will require two  session factories,
> >>>> two open session filters, two persistence services and two hibernate
> >>>> annotations decorators. BUT I'm not completely sure since I haven't
> >>>> tried it (yet).
> >>>>
> >>>> May I ask why do you need two databases?
> >>>> Could two different applications and a single sign on solve your
> >>> problems?
> >>>> --
> >>>> Alejandro Scandroli
> >>>> Amneris: We build process-driven web applications.
> >>>> http://www.amneris.es
> >>>>
> >>>> On Dec 1, 2007 11:15 AM, Pablo Gra~na <pablo.grana@...> wrote:
> >>>>> Hi there.
> >>>>>
> >>>>> Is it possible to have multiple databases in trails? This implies
> >>> having
> >>>>> muiltiple session factories and a way of associating a session factory
> >>>>> to an entity.
> >>>>>
> >>>>> Thanks a lot.
> >>>>>
> >>>>> --
> >>>>> Pablo Gra\~na
> >>>>> Chief Architect
> >>>>> Globant
> >>>>> Arg Office: +54 (11) 4109 1743
> >>>>> UK  Office: +44 (20) 7043 8269 int 8043
> >>>>> US  Office: +1 (212) 400 7686 int 8043
> >>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe from this list please visit:
> >>>>>
> >>>>>     http://xircles.codehaus.org/manage_email
> >>>>>
> >>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe from this list please visit:
> >>>>
> >>>>     http://xircles.codehaus.org/manage_email
> >>>>
> >>>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list please visit:
> >>
> >>     http://xircles.codehaus.org/manage_email
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
>
> --
> Pablo Gra\~na
> Chief Architect
> Globant
> Arg Office: +54 (11) 4109 1743
> UK  Office: +44 (20) 7043 8269 int 8043
> US  Office: +1 (212) 400 7686 int 8043
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email