@@ -2624,7 +2624,7 @@ clobReader.close();</programlisting>
2624
2624
2625
2625
<para >The SQL standard allows for selecting rows based on an expression
2626
2626
that includes a variable list of values. A typical example would be
2627
- " select * from < code > T_ACTOR where id in (1, 2, 3)</code >. This variable
2627
+ < code > select * from T_ACTOR where id in (1, 2, 3)</code >. This variable
2628
2628
list is not directly supported for prepared statements by the JDBC
2629
2629
standard; you cannot declare a variable number of placeholders. You need
2630
2630
a number of variations with the desired number of placeholders prepared,
@@ -2648,8 +2648,8 @@ clobReader.close();</programlisting>
2648
2648
<para >In addition to the primitive values in the value list, you can
2649
2649
create a <classname >java.util.List</classname > of object arrays. This
2650
2650
list would support multiple expressions defined for the <code >in</code >
2651
- clause such as "< symbol >select * from T_ACTOR where (id, last_name) in
2652
- ((1, 'Johnson'), (2, 'Harrop'))</symbol >". <!-- Is the preceding punctuated correctly? I'm not sure what to put in code font. TR: OK. --> This
2651
+ clause such as < code >select * from T_ACTOR where (id, last_name) in
2652
+ ((1, 'Johnson'), (2, 'Harrop'))</code >. This
2653
2653
of course requires that your database supports this syntax.</para >
2654
2654
</section >
2655
2655
@@ -2975,18 +2975,34 @@ public class DataAccessUnitTestTemplate {
2975
2975
<para >The first option might be easy if the application is in your
2976
2976
control, and not otherwise. Some suggestions for how to implement this
2977
2977
are<itemizedlist >
2978
+
2978
2979
<listitem >
2979
2980
<para >Make the cache initialize lazily on first usage, which
2980
2981
improves application startup time</para >
2981
2982
</listitem >
2982
2983
2984
+ <listitem >
2985
+ <para >Have your cache or a separate component that
2986
+ initializes the cache implement <code >Lifecycle</code > or
2987
+ <code >SmartLifecycle</code >. When the application context
2988
+ starts up a <code >SmartLifecycle</code > can be automatically
2989
+ started if its <code >autoStartup</code > flag is set,
2990
+ and a <code >Lifecycle</code > can be started
2991
+ manually by calling
2992
+ <code >ConfigurableApplicationContext.start()</code > on the
2993
+ enclosing context.
2994
+ </para >
2995
+ </listitem >
2996
+
2983
2997
<listitem >
2984
2998
<para >Use a Spring <code >ApplicationEvent</code > or similar
2985
2999
custom observer mechanism to trigger the cache initialization.
2986
3000
<code >ContextRefreshedEvent</code > is always published by the
2987
3001
context when it is ready for use (after all beans have been
2988
- initialized), so that is often a useful hook.</para >
3002
+ initialized), so that is often a useful hook (this is
3003
+ how the <code >SmartLifecycle</code > works by default).</para >
2989
3004
</listitem >
3005
+
2990
3006
</itemizedlist ></para >
2991
3007
2992
3008
<para >The second option can also be easy. Some suggestions on how to
0 commit comments