<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-US link=blue vlink=purple>
<div class=Section1>
<div>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>“weekly status” – was a wrong header
for the letter.<o:p></o:p></span></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>> </span>Max, why ConsoleConfiguration ->
localCfg.setProperty( "hibernate.temp.use_jdbc_metadata_defaults",
"false" ); - is false not a true?<o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>> </span>Is the reason the same - autoConfigureDialect
is commented:<o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>> </span>//autoConfigureDialect(localCfg); Disabled
for now since it causes very looong timeouts for non-running databases + i
havent been needed until now...<o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>> </span>autoConfigureDialect<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span style='color:#1F497D'>> </span>yes - a non-started
database causes the whole ui to hang.<br>
<span style='color:#1F497D'>> </span>So why GenerateEntitiesWizard ->
performFinish ->
wc.setAttribute("hibernate.temp.use_jdbc_metadata_defaults", true);<o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>> </span>Do you know some other way - to check
non-running database quickly without getConnection?<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span style='color:#1F497D'>> </span>look at the datbase
url, driverclass and look at the info in DTP data or if that is not enough ask
the user for the db, <br>
<span style='color:#1F497D'>> </span>It is possible to enhance
SettingsFactory -> buildSettings here:<o:p></o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
Wingdings'>è</span><span style='font-size:7.0pt'> </span>if ( useJdbcMetadata )
{<o:p></o:p></p>
</div>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'>
<div>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>it
is possible to cache databaseName & databaseMajorVersion to read it only
once…<o:p></o:p></p>
</div>
</blockquote>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='color:#1F497D'>>
</span>No, what should it based the cache on ?<span style='color:#1F497D'><o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>Firstly I think just simple
properties: databaseName & databaseMajorVersion be suitable…<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>If useJdbcMetadata and databaseName
== null & databaseMajorVersion == null<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>Then get connection and
initialize as it is. So it call getConnection only once – but this is SettingsFactory
– not suitable solution…<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>It seems like a “if (
useJdbcMetadata ) {” block – not a right place in SettingsFactory ->
buildSettings, seems should be parameters for buildSettings function - databaseName,
databaseMajorVersion. databaseName, databaseMajorVersion – should be
initialized from other place.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='color:#1F497D'>In
any case not a subject to discuss - if</span><br>
<span style='color:#1F497D'>> </span>Not a job for hibernate core to keep
track of.<span style='color:#1F497D'><o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>Just setAttribute("hibernate.temp.use_jdbc_metadata_defaults",
true) or autoConfigureDialect (better if not a job of hibernate core) could be
a nice feature,<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>It prevent user to make one
more configuration step to setup dialect by hands…<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>It’ a pity if not
possible to use “hibernate.temp.use_jdbc_metadata_defaults” or autoConfigureDialect
…<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='color:#1F497D'>May
be the solution is to get </span><span style='font-size:11.0pt;font-family:
"Calibri","sans-serif";color:#1F497D'>databaseName & databaseMajorVersion or
in general dialect in independent thread – only synchronization issue,<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>So Hibernate Console Config could
display it’s nodes and in case when the user try to expand “Database”
(here is a try to connect to db in any case) - db dialect could get its value. But
in case if db dialect doesn’t get value – the user should specify
this by hands… Look like too much “could” and “but”,
but this is only specific cases – in general it seems useful and possible
to use (autoConfigureDialect in independent thread). In the bad case we just
get a long running thread.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>Vitali</span><br>
<br>
<br>
<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>
</div>
</body>
</html>