What's the deal with named Inlines?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

What's the deal with named Inlines?

Randy Phillips-2
In the last few days I've gotten conflicing opinions on how named
inlines work. I've always thought that when you name an inline the
result set can be reused several times on the same page without a
return trip to the database, a cached query in other words. But some
have suggested to me that each instance of row: -inlinename='xxx'
represents a return trip to the database.

Which is true?

Thanks.

--
Rp

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

Adam Randall-2
On Sat, 17 Feb 2007 13:15:24 -0600, Randy Phillips wrote:

> In the last few days I've gotten conflicing opinions on how named
> inlines work. I've always thought that when you name an inline the
> result set can be reused several times on the same page without a
> return trip to the database, a cached query in other words. But some
> have suggested to me that each instance of row: -inlinename='xxx'
> represents a return trip to the database.
>
> Which is true?
>
> Thanks.

When specifying a named inline, the data is fetched once, then released at the end of the page. This means that you can use it multiple times and only hit the database once.

Personally, I prefer to capture the data in an array, and use that multiple times. It just makes more sense to me :)

Adam.

--
-----------------------------------------------------------------------
Adam Randall                                       http://www.xaren.net
[hidden email]                                   AIM/iChat:  blitz574

"Macintosh users are a special case. They care passionately about the
Mac OS and would rewire their own bodies to run on Mac OS X if such a
thing were possible." -- Peter H. Lewis

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

Jim Van Heule-3
That makes sense.

Now for question #2...

What's the difference between the three methods shown below? All  
perform the same task. What benefit does one hold over another? What  
are the negatives?

Method #1: Nested Inlines
-------------------------
Inline:...;
        Records;
                Inline:...;
                /Inline;
        /Records
/Inline;


Method#2: Named Inlines
-----------------------
Inline:
        -InlineName='ABC',...;
/Inline;

Records: -Inlinename='ABC';
        Inline:...;
        /Inline;
/Records


Method#3: ResultSet
-----------------------
Inline:
        -InlineName='ABC',...;
/Inline;

ResultSet: -Inlinename='ABC';
        Records;
                Inline:...;
                /Inline;
        /Records
/ResultSet;


--
Jim Van Heule
Heunox Corporation
(616) 844-0066


On Feb 17, 2007, at 2:39 PM, Adam Randall wrote:

> On Sat, 17 Feb 2007 13:15:24 -0600, Randy Phillips wrote:
>> In the last few days I've gotten conflicing opinions on how named
>> inlines work. I've always thought that when you name an inline the
>> result set can be reused several times on the same page without a
>> return trip to the database, a cached query in other words. But some
>> have suggested to me that each instance of row: -inlinename='xxx'
>> represents a return trip to the database.
>>
>> Which is true?
>>
>> Thanks.
>
> When specifying a named inline, the data is fetched once, then  
> released at the end of the page. This means that you can use it  
> multiple times and only hit the database once.
>
> Personally, I prefer to capture the data in an array, and use that  
> multiple times. It just makes more sense to me :)
>
> Adam.
>
> --
> ----------------------------------------------------------------------
> -
> Adam Randall                                       http://
> www.xaren.net
> [hidden email]                                   AIM/iChat:  
> blitz574
>
> "Macintosh users are a special case. They care passionately about the
> Mac OS and would rewire their own bodies to run on Mac OS X if such a
> thing were possible." -- Peter H. Lewis
>
> ============================================
> Attend the Lasso Summit
> March 2-4, 2007 in Fort Lauderdale, FL
> http://www.LassoSummit.com/
> ============================================
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

Adam Randall-2
On Sat, 17 Feb 2007 14:51:09 -0500, Jim Van Heule wrote:

> That makes sense.
>
> Now for question #2...
>
> What's the difference between the three methods shown below? All
> perform the same task. What benefit does one hold over another? What
> are the negatives?
>
> Method #1: Nested Inlines
> -------------------------
> Inline:...;
> Records;
> Inline:...;
> /Inline;
> /Records
> /Inline;
>
>
> Method#2: Named Inlines
> -----------------------
> Inline:
> -InlineName='ABC',...;
> /Inline;
>
> Records: -Inlinename='ABC';
> Inline:...;
> /Inline;
> /Records
>
>
> Method#3: ResultSet
> -----------------------
> Inline:
> -InlineName='ABC',...;
> /Inline;
>
> ResultSet: -Inlinename='ABC';
> Records;
> Inline:...;
> /Inline;
> /Records
> /ResultSet;

Method 2 and 3 are pretty much the same, method 1 has no relevance as it's not reusing anything.

Nested inlines are crucial for performance, where the inner inlines reuse the outer inline's connection. Each of the nested inlines will obviously communicate to the server, but through the same connection which allows for better performance, as well as being able to use some features of the datasource that require the same connection.

The question of named inlines was if you use the named result set in multiple places on a page does it pull the data from the datasource each time. The answer to that is no, it'll pull just once and reuse that same information each time.

If it doesn't, then it would be a bug.

Adam.

--
-----------------------------------------------------------------------
Adam Randall                                       http://www.xaren.net
[hidden email]                                   AIM/iChat:  blitz574

"Macintosh users are a special case. They care passionately about the
Mac OS and would rewire their own bodies to run on Mac OS X if such a
thing were possible." -- Peter H. Lewis

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

Randy Phillips-2
In reply to this post by Jim Van Heule-3
On 2/17/07, Jim Van Heule <[hidden email]> wrote:

> That makes sense.
>
> Now for question #2...
>
> What's the difference between the three methods shown below? All
> perform the same task. What benefit does one hold over another? What
> are the negatives?
>
> Method #1: Nested Inlines
> -------------------------
> Inline:...;
>         Records;
>                 Inline:...;
>                 /Inline;
>         /Records
> /Inline;
>
>
> Method#2: Named Inlines
> -----------------------
> Inline:
>         -InlineName='ABC',...;
> /Inline;
>
> Records: -Inlinename='ABC';
>         Inline:...;
>         /Inline;
> /Records
>
>
> Method#3: ResultSet
> -----------------------
> Inline:
>         -InlineName='ABC',...;
> /Inline;
>
> ResultSet: -Inlinename='ABC';
>         Records;
>                 Inline:...;
>                 /Inline;
>         /Records
> /ResultSet;
>
>
> --
> Jim Van Heule
> Heunox Corporation
> (616) 844-0066
>
>

The big advantage to Method #3 (from what I understand) is that you
can have multiple sql statements in a single inline that generates
different results sets for each. The results can be displayed as
[ResultSet: 1], [ResultSet: 2], etc. So it has that benefit over a
named inline. But I assume each sql statement represents a trip to the
mysql server even though they are in the same inline. Good question
though.

You can use named inlines with ResultSet but I see little advantage
compared to just using regular named inlines. Seems like a lot more
coding to me and harder to read too.

If Adam is  correct (and I think he is) Method#2 allows you to spit
out the same result set multiple times on the same page with no return
trip to the db server. That's what I was interested in knowing.

Method#1 seems like a method for doing sub queries rather than a
method for trying to query once and reusing the results multiple
times. Not sure how that relates.

--
Rp

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

Jim Van Heule-3
In reply to this post by Adam Randall-2
I understand the use of a named Inline in multiple places.

So why is it that Method 3 tends to be much more stable than Method 2  
if they are pretty much the same? Basically, I'm trying to understand  
what ResultSet does differently than Named Inlines.

In regards to nested Inlines, that's great if you are using the same  
datasource. If they are differing datasources however, I find it  
difficult to imagine that they use the same connection.

Also, it seems that if the outer Inline of a nested Inline keeps a  
connection open for more than 60 seconds, it times out regardless of  
what the timeout settings are in Lasso Admin which eventually causes  
the Lasso Site to crash. In my instance, since I have long  
connections, I have been directed away from nested Inlines and  
encouraged to use ResultSets. Thus, that is the reason I was asking  
the differences. I just wanted to get a better idea of their inner  
workings to understand why a ResultSet seems to be the most stable  
course of action of the three methods.

--
Jim Van Heule
Heunox Corporation
(616) 844-0066


On Feb 17, 2007, at 3:05 PM, Adam Randall wrote:

> On Sat, 17 Feb 2007 14:51:09 -0500, Jim Van Heule wrote:
>> That makes sense.
>>
>> Now for question #2...
>>
>> What's the difference between the three methods shown below? All
>> perform the same task. What benefit does one hold over another? What
>> are the negatives?
>>
>> Method #1: Nested Inlines
>> -------------------------
>> Inline:...;
>> Records;
>> Inline:...;
>> /Inline;
>> /Records
>> /Inline;
>>
>>
>> Method#2: Named Inlines
>> -----------------------
>> Inline:
>> -InlineName='ABC',...;
>> /Inline;
>>
>> Records: -Inlinename='ABC';
>> Inline:...;
>> /Inline;
>> /Records
>>
>>
>> Method#3: ResultSet
>> -----------------------
>> Inline:
>> -InlineName='ABC',...;
>> /Inline;
>>
>> ResultSet: -Inlinename='ABC';
>> Records;
>> Inline:...;
>> /Inline;
>> /Records
>> /ResultSet;
>
> Method 2 and 3 are pretty much the same, method 1 has no relevance  
> as it's not reusing anything.
>
> Nested inlines are crucial for performance, where the inner inlines  
> reuse the outer inline's connection. Each of the nested inlines  
> will obviously communicate to the server, but through the same  
> connection which allows for better performance, as well as being  
> able to use some features of the datasource that require the same  
> connection.
>
> The question of named inlines was if you use the named result set  
> in multiple places on a page does it pull the data from the  
> datasource each time. The answer to that is no, it'll pull just  
> once and reuse that same information each time.
>
> If it doesn't, then it would be a bug.
>
> Adam.
>
> --
> ----------------------------------------------------------------------
> -
> Adam Randall                                       http://
> www.xaren.net
> [hidden email]                                   AIM/iChat:  
> blitz574
>
> "Macintosh users are a special case. They care passionately about the
> Mac OS and would rewire their own bodies to run on Mac OS X if such a
> thing were possible." -- Peter H. Lewis
>
> ============================================
> Attend the Lasso Summit
> March 2-4, 2007 in Fort Lauderdale, FL
> http://www.LassoSummit.com/
> ============================================
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

Marc Vos-3
In reply to this post by Jim Van Heule-3
Hi Jim,

Jim Van Heule wrote:

> That makes sense.
>
> Now for question #2...
>
> What's the difference between the three methods shown below? All
> perform the same task. What benefit does one hold over another? What
> are the negatives?
>
> Method #1: Nested Inlines
> -------------------------
> Inline:...;
>     Records;
>         Inline:...;
>         /Inline;
>     /Records
> /Inline;
>
This a standard use. The inner inline uses the DB connection of the
outer inline. If you use the OUTER inline multiple times on a page, then
you would have multiple DB access by Lasso.

>
> Method#2: Named Inlines
> -----------------------
> Inline:
>     -InlineName='ABC',...;  
> /Inline;
>
> Records: -Inlinename='ABC';
>     Inline:...;
>     /Inline;
> /Records
>
>
This is of no use. The outer ABC is overwritten by the inner ABC, as a
matter of fact by the last inner inline performed at the last record of
the outer inline.

> Method#3: ResultSet
> -----------------------
> Inline:
>     -InlineName='ABC',...;  
> /Inline;
>
> ResultSet: -Inlinename='ABC';
>     Records;
>         Inline:...;
>         /Inline;
>     /Records
> /ResultSet;
>
This is basically Method #1 with the possibilty of multiple use in the
same page, without the ABC-set accessing the DB again. The inner inline
may differ, of course. I use inline(-inlinename='ABC') instead of
resultset. I think they are the same, but resultset sound more DB-like.
Like 'field' and the 'column' keyword.

- -
regards,
Marc Vos


============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

Fletcher Sandbeck
In reply to this post by Jim Van Heule-3
> I understand the use of a named Inline in multiple places.
>
> So why is it that Method 3 tends to be much more stable than Method 2  
> if they are pretty much the same? Basically, I'm trying to understand  
> what ResultSet does differently than Named Inlines.

When you specify an -InlineName within an inline Lasso stores the state
of the inline and allows you to retrieve it later on the page.  If you
don't specify an -InlineName then Lasso deletes the state of the inline
as soon as it hits the closing inline.

[ResultSet: -InlineName='...'] ... [/ResultSet] has two important
advantages over [Records: -InlineName='...'] ... [/Records].

First, it allows you to use any tags that you would have used within the
inline itself.  You can use [Found_Count], [Shown_Count], [Records] ...
[/Records], and Field within a ResultSet block.  If you use a Records
block you can only use [Field] within it and must store the found count
and other values separately.

Second, ResultSet allows you to access multiple result sets from data
sources which return them.  In particular, if a MySQL statement contains
multiple SQL statements then you can access the results of each of them
using [ResultSet: #].  The [ResultSet_Count] tag will tell you how many
result sets the data source returned.

I can't see any reason why ResultSet would be more stable than Records,
but it is definitely easier to use.

> In regards to nested Inlines, that's great if you are using the same  
> datasource. If they are differing datasources however, I find it  
> difficult to imagine that they use the same connection.

Lasso uses different connections for different data sources and for
different hosts.  When Lasso processes an inline it checks to see if the
surrounding inline references the same host.  If it does then it re-uses
the connection.  If it does not then it opens a new connection.

In general use you don't need to worry about what connections are being
used, but for performance tuning there can be advantages in forcing
Lasso to use one database connection for many inlines or in forcing
Lasso to open new connections.

Also note that some data sources, such as some JDBC drivers, will use
connection pooling which further abstracts when connections are opened
and closed.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Director of Product Development       http://www.lassostudio.com
OmniPilot Software, Inc.                http://www.omnipilot.com

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

decorior
If the same inlines are on the page then does it reuse the prior  
connection?
On Feb 18, 2007, at 10:06 AM, Fletcher Sandbeck wrote:

>> I understand the use of a named Inline in multiple places.
>>
>> So why is it that Method 3 tends to be much more stable than Method 2
>> if they are pretty much the same? Basically, I'm trying to understand
>> what ResultSet does differently than Named Inlines.
>
> When you specify an -InlineName within an inline Lasso stores the  
> state
> of the inline and allows you to retrieve it later on the page.  If you
> don't specify an -InlineName then Lasso deletes the state of the  
> inline
> as soon as it hits the closing inline.
>
> [ResultSet: -InlineName='...'] ... [/ResultSet] has two important
> advantages over [Records: -InlineName='...'] ... [/Records].
>
> First, it allows you to use any tags that you would have used  
> within the
> inline itself.  You can use [Found_Count], [Shown_Count],  
> [Records] ...
> [/Records], and Field within a ResultSet block.  If you use a Records
> block you can only use [Field] within it and must store the found  
> count
> and other values separately.
>
> Second, ResultSet allows you to access multiple result sets from data
> sources which return them.  In particular, if a MySQL statement  
> contains
> multiple SQL statements then you can access the results of each of  
> them
> using [ResultSet: #].  The [ResultSet_Count] tag will tell you how  
> many
> result sets the data source returned.
>
> I can't see any reason why ResultSet would be more stable than  
> Records,
> but it is definitely easier to use.
>
>> In regards to nested Inlines, that's great if you are using the same
>> datasource. If they are differing datasources however, I find it
>> difficult to imagine that they use the same connection.
>
> Lasso uses different connections for different data sources and for
> different hosts.  When Lasso processes an inline it checks to see  
> if the
> surrounding inline references the same host.  If it does then it re-
> uses
> the connection.  If it does not then it opens a new connection.
>
> In general use you don't need to worry about what connections are  
> being
> used, but for performance tuning there can be advantages in forcing
> Lasso to use one database connection for many inlines or in forcing
> Lasso to open new connections.
>
> Also note that some data sources, such as some JDBC drivers, will use
> connection pooling which further abstracts when connections are opened
> and closed.
>
> [fletcher]
> --
> Fletcher Sandbeck                         [hidden email]
> Director of Product Development       http://www.lassostudio.com
> OmniPilot Software, Inc.                http://www.omnipilot.com
>
> ============================================
> Attend the Lasso Summit
> March 2-4, 2007 in Fort Lauderdale, FL
> http://www.LassoSummit.com/
> ============================================
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: What's the deal with named Inlines?

Jim Van Heule-3
In reply to this post by Fletcher Sandbeck
Thank you for the excellent explanation Fletcher.

I think I finally have it clear in my head.

--
Jim Van Heule
Heunox Corporation
(616) 844-0066


On Feb 18, 2007, at 12:06 PM, Fletcher Sandbeck wrote:

>> I understand the use of a named Inline in multiple places.
>>
>> So why is it that Method 3 tends to be much more stable than Method 2
>> if they are pretty much the same? Basically, I'm trying to understand
>> what ResultSet does differently than Named Inlines.
>
> When you specify an -InlineName within an inline Lasso stores the  
> state
> of the inline and allows you to retrieve it later on the page.  If you
> don't specify an -InlineName then Lasso deletes the state of the  
> inline
> as soon as it hits the closing inline.
>
> [ResultSet: -InlineName='...'] ... [/ResultSet] has two important
> advantages over [Records: -InlineName='...'] ... [/Records].
>
> First, it allows you to use any tags that you would have used  
> within the
> inline itself.  You can use [Found_Count], [Shown_Count],  
> [Records] ...
> [/Records], and Field within a ResultSet block.  If you use a Records
> block you can only use [Field] within it and must store the found  
> count
> and other values separately.
>
> Second, ResultSet allows you to access multiple result sets from data
> sources which return them.  In particular, if a MySQL statement  
> contains
> multiple SQL statements then you can access the results of each of  
> them
> using [ResultSet: #].  The [ResultSet_Count] tag will tell you how  
> many
> result sets the data source returned.
>
> I can't see any reason why ResultSet would be more stable than  
> Records,
> but it is definitely easier to use.
>
>> In regards to nested Inlines, that's great if you are using the same
>> datasource. If they are differing datasources however, I find it
>> difficult to imagine that they use the same connection.
>
> Lasso uses different connections for different data sources and for
> different hosts.  When Lasso processes an inline it checks to see  
> if the
> surrounding inline references the same host.  If it does then it re-
> uses
> the connection.  If it does not then it opens a new connection.
>
> In general use you don't need to worry about what connections are  
> being
> used, but for performance tuning there can be advantages in forcing
> Lasso to use one database connection for many inlines or in forcing
> Lasso to open new connections.
>
> Also note that some data sources, such as some JDBC drivers, will use
> connection pooling which further abstracts when connections are opened
> and closed.
>
> [fletcher]
> --
> Fletcher Sandbeck                         [hidden email]
> Director of Product Development       http://www.lassostudio.com
> OmniPilot Software, Inc.                http://www.omnipilot.com
>
> ============================================
> Attend the Lasso Summit
> March 2-4, 2007 in Fort Lauderdale, FL
> http://www.LassoSummit.com/
> ============================================
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage