This project is read-only.

Some issues found in beta version

Oct 31, 2008 at 7:10 AM
Despite I found ArchGuide very interesting, I found some consistencies in the beta version of your book. At least I think of them as consistencies, and if I am wrong, please correct me. Here is the list:

On page 29 there is a list of architectural styles. And there is a style called 'Grid' which is described as using CSS to control web page structure. Is it really an architecure style? Or you mean 'Grid computing' and the description a 'bug'?

On page 207 there is an advice saying 'If performing multiple inserts, updates and deletes together, wrap them in a transaction for better performance'. I find it confusing, because primary goual of transactions is maintaining data consistency. Saying that wrapping data access in transaction results better performance without pointing data source you are talking about can be dangerous - maybe there are some source which can benefit from this, but some certainly can't.One collegue suggested that you mean 'wrapping in one batch', but as I remember batching SQLs is covered by other advice.

On the same page you use term 'automatic transactions' multiple times. I suppose you mean those from 'System.Transactions' but I found this not obvious for everyone. Especially sentence 'If a single transaction spans multiple databases, you should use automatic transactions' would have been more readable if you had used 'distributed transactions'.

And the last one. When describing connections in DAL you provider these two advices:
Do not open and close a connection after each transaction. Consider keeping the connection open for a configurable amount of time to allow reuse.
Do not rely on garbage collection to free connections. Free them explicitly as soon as possible
I find them a little bit contradictory. On one hand you advice to close (meaning release to pool) connection ASAP (meaning just after IDbCommand is closes?) and on the other you say that caching connections and keeping them open for some time is good idea. After reading both advices I am confused whether I can rely on ADO.NET to cache connections or not.
Nov 6, 2008 at 2:24 AM
Hi SzymonPobiega,

On the Grid point.  That's just a clear bug. We already removed it.

On page 207 - transactions and batching. 
>>Yes, your collegue was right about the intention. I just removed the line completely since we already talked about using of Transactions and preserving the ACID properties of the database earlier in the section. 

On the same page you use term 'automatic transactions' multiple  -
>>We will clarify this point in the guidance. I didn't add this guidance myself so I'll have to clarify with the team.  

And the last one. When describing connections in DAL you provider these two advices-
>>We will clarify this as well.
When you close connections during connection pooling, they will return to the pool.  There is some overhead, but very small.  What we wanted people to look at was how often they were opening and closing connections.  If you open a connection, do a read, and close it, then do the same thing a millisecond later and keep doing that in a loop 100 times, that unlikely to be the most efficient or effective way. If the loop will run 100 times in quick succession, open the connection, run the loop to fetch data and then close the connection. This is an extreme case, but hopefully illustrates the point. We will reword or remove the "configurable" sentence.

On garbage collection, the point is that the connection is done with.  You want to free the connection and return it to the pool for reuse.  To wait for the garbage collector means that you've got a connection open longer when there is no possibility that you'll ever use it again.

Let me know if something here doesn't make sense.

Nov 20, 2008 at 2:26 AM
These issues should be cleared up in BETA 2, which we posted this week.  Let us know if you feel they were not.

Rob Boucher Jr
Nov 21, 2008 at 7:01 AM
Perhaps, CSS Grid referred to something like It's a real framework for Presentation Layer.
Aug 12, 2013 at 1:48 PM
Thanks admin.