Hibernate on Ubuntu 20.04 hang on SqlServer select

Hi,
I moved from Windows to Ubuntu 20.04.
The same App that works under Windows and under Ubuntu Server 18.10 doesn’t work in my Ubuntu 20.04.
a Select hang for an infinite time. It’s just a simple query on a small table.
If I use session.createNativeQuery(“SELECT * FROM tabName WHERE id = ‘xxx’”) everything works, but if I use session.createQuery(“FROM tabName WHERE id = ‘xxx’”) it just hangs for an infinite time.
From the logs I see the HQL transaltion to SQL is correct.
This the log file. Any idea?

2020-07-10 10:53:13,842 TRACE [main]: (JdbcCoordinatorImpl.java:263) JdbcCoordinatorImpl - Starting afterQuery statement execution processing [AFTER_TRANSACTION]
2020-07-10 10:53:13,842 TRACE [main]: (StatefulPersistenceContext.java:916) StatefulPersistenceContext - Initializing non-lazy collections
2020-07-10 10:53:18,835 TRACE [main]: (QueryPlanCache.java:152) QueryPlanCache - Unable to locate HQL query plan in cache; generating (FROM Utenti as u where u.utente = ‘enrico’)
2020-07-10 10:53:18,844 DEBUG [main]: (QueryTranslatorImpl.java:277) QueryTranslatorImpl - parse() - HQL: FROM elettrica.jelettrixbase.database.Utenti as u where u.utente = ‘enrico’
2020-07-10 10:53:18,897 DEBUG [main]: (QueryTranslatorImpl.java:295) QueryTranslatorImpl - — HQL AST —
-[QUERY] Node: ‘query’
±[SELECT_FROM] Node: ‘SELECT_FROM’
| -[FROM] Node: ‘FROM’
| -[RANGE] Node: ‘RANGE’
| ±[DOT] Node: ‘.’
| | ±[DOT] Node: ‘.’
| | | ±[DOT] Node: ‘.’
| | | | ±[IDENT] Node: ‘elettrica’
| | | | -[IDENT] Node: ‘jelettrixbase’
| | | -[IDENT] Node: ‘database’
| | -[IDENT] Node: ‘Utenti’
| -[ALIAS] Node: ‘u’
-[WHERE] Node: ‘where’
-[EQ] Node: ‘=’
±[DOT] Node: ‘.’
| ±[IDENT] Node: ‘u’
| -[IDENT] Node: ‘utente’
-[QUOTED_STRING] Node: ‘‘enrico’’

2020-07-10 10:53:18,907 DEBUG [main]: (ErrorCounter.java:95) ErrorCounter - throwQueryException() : no errors
2020-07-10 10:53:18,912 DEBUG [main]: (HqlSqlBaseWalker.java:124) HqlSqlBaseWalker - select << begin [level=1, statement=select]
2020-07-10 10:53:18,914 DEBUG [main]: (FromElement.java:149) FromElement - FromClause{level=1} : elettrica.jelettrixbase.database.Utenti (u) -> utenti0_
2020-07-10 10:53:18,921 DEBUG [main]: (FromReferenceNode.java:60) FromReferenceNode - Resolved : u -> utenti0_.UTENTE
2020-07-10 10:53:18,928 TRACE [main]: (FromElement.java:668) FromElement - Handling property dereference [elettrica.jelettrixbase.database.Utenti (u) -> utente (class)]
2020-07-10 10:53:18,929 DEBUG [main]: (DotNode.java:661) DotNode - getDataType() : utente -> org.hibernate.type.StringType@46b695ec
2020-07-10 10:53:18,964 DEBUG [main]: (FromReferenceNode.java:60) FromReferenceNode - Resolved : u.utente -> utenti0_.UTENTE
2020-07-10 10:53:18,979 DEBUG [main]: (HqlSqlBaseWalker.java:128) HqlSqlBaseWalker - select : finishing up [level=1, statement=select]
2020-07-10 10:53:18,984 DEBUG [main]: (HqlSqlWalker.java:758) HqlSqlWalker - processQuery() : ( SELECT ( FromClause{level=1} UTENTI utenti0_ ) ( where ( = ( utenti0_.UTENTE utenti0_.UTENTE utente ) ‘enrico’ ) ) )
2020-07-10 10:53:18,988 DEBUG [main]: (HqlSqlWalker.java:1034) HqlSqlWalker - Derived SELECT clause created.
2020-07-10 10:53:18,990 DEBUG [main]: (JoinProcessor.java:172) JoinProcessor - Using FROM fragment [UTENTI utenti0_]
2020-07-10 10:53:18,991 DEBUG [main]: (HqlSqlBaseWalker.java:132) HqlSqlBaseWalker - select >> end [level=1, statement=select]
2020-07-10 10:53:19,009 DEBUG [main]: (QueryTranslatorImpl.java:264) QueryTranslatorImpl - — SQL AST —
-[SELECT] QueryNode: ‘SELECT’ querySpaces (UTENTI)
±[SELECT_CLAUSE] SelectClause: ‘{derived select clause}’
| ±[SELECT_EXPR] SelectExpressionImpl: ‘utenti0_.UTENTE as UTENTE1_65_’ {FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=u,role=null,tableName=UTENTI,tableAlias=utenti0_,origin=null,columns={,className=elettrica.jelettrixbase.database.Utenti}}}
| -[SQL_TOKEN] SqlFragment: ‘utenti0_.ABILITATO as ABILITAT2_65_, utenti0_.AGGFOLDER as AGGFOLDE3_65_, utenti0_.AGGPASSWORD as AGGPASSW4_65_, utenti0_.AGGUSER as AGGUSER5_65_, utenti0_.DESCRIZIONE as DESCRIZI6_65_, utenti0_.GRUPPO as GRUPPO7_65_, utenti0_.IP as IP8_65_, utenti0_.LABEL_PRINTER_NAME as LABEL_PR9_65_, utenti0_.MAILADDRESS as MAILADD10_65_, utenti0_.MAILPASSWORD as MAILPAS11_65_, utenti0_.MAILPOP as MAILPOP12_65_, utenti0_.MAILSMTP as MAILSMT13_65_, utenti0_.MAILUSER as MAILUSE14_65_, utenti0_.PASSWORD as PASSWOR15_65_, utenti0_.PRINTER_SERVER as PRINTER16_65_, utenti0_.REPARTO as REPARTO17_65_, utenti0_.RFIL as RFIL18_65_, utenti0_.UTENTE_ELETTRIX as UTENTE_19_65_’
±[FROM] FromClause: ‘FROM’ FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[u], fromElementByTableAlias=[utenti0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
| -[FROM_FRAGMENT] FromElement: ‘UTENTI utenti0_’ FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=u,role=null,tableName=UTENTI,tableAlias=utenti0_,origin=null,columns={,className=elettrica.jelettrixbase.database.Utenti}}
-[WHERE] SqlNode: ‘where’
-[EQ] BinaryLogicOperatorNode: ‘=’
±[DOT] DotNode: ‘utenti0_.UTENTE’ {propertyName=utente,dereferenceType=PRIMITIVE,getPropertyPath=utente,path=u.utente,tableAlias=utenti0_,className=elettrica.jelettrixbase.database.Utenti,classAlias=u}
| ±[ALIAS_REF] IdentNode: ‘utenti0_.UTENTE’ {alias=u, className=elettrica.jelettrixbase.database.Utenti, tableAlias=utenti0_}
| -[IDENT] IdentNode: ‘utente’ {originalText=utente}
-[QUOTED_STRING] LiteralNode: ‘‘enrico’’

2020-07-10 10:53:19,029 DEBUG [main]: (ErrorCounter.java:95) ErrorCounter - throwQueryException() : no errors
2020-07-10 10:53:19,034 DEBUG [main]: (QueryTranslatorImpl.java:246) QueryTranslatorImpl - HQL: FROM elettrica.jelettrixbase.database.Utenti as u where u.utente = ‘enrico’
2020-07-10 10:53:19,035 DEBUG [main]: (QueryTranslatorImpl.java:247) QueryTranslatorImpl - SQL: select utenti0_.UTENTE as UTENTE1_65_, utenti0_.ABILITATO as ABILITAT2_65_, utenti0_.AGGFOLDER as AGGFOLDE3_65_, utenti0_.AGGPASSWORD as AGGPASSW4_65_, utenti0_.AGGUSER as AGGUSER5_65_, utenti0_.DESCRIZIONE as DESCRIZI6_65_, utenti0_.GRUPPO as GRUPPO7_65_, utenti0_.IP as IP8_65_, utenti0_.LABEL_PRINTER_NAME as LABEL_PR9_65_, utenti0_.MAILADDRESS as MAILADD10_65_, utenti0_.MAILPASSWORD as MAILPAS11_65_, utenti0_.MAILPOP as MAILPOP12_65_, utenti0_.MAILSMTP as MAILSMT13_65_, utenti0_.MAILUSER as MAILUSE14_65_, utenti0_.PASSWORD as PASSWOR15_65_, utenti0_.PRINTER_SERVER as PRINTER16_65_, utenti0_.REPARTO as REPARTO17_65_, utenti0_.RFIL as RFIL18_65_, utenti0_.UTENTE_ELETTRIX as UTENTE_19_65_ from UTENTI utenti0_ where utenti0_.UTENTE=‘enrico’
2020-07-10 10:53:19,036 DEBUG [main]: (ErrorCounter.java:95) ErrorCounter - throwQueryException() : no errors
2020-07-10 10:53:19,038 TRACE [main]: (HQLQueryPlan.java:385) HQLQueryPlan - HQL param location recognition took 68.510 nanoseconds (FROM Utenti as u where u.utente = ‘enrico’)
2020-07-10 10:53:20,233 TRACE [main]: (QueryPlanCache.java:157) QueryPlanCache - Located HQL query plan in cache (FROM Utenti as u where u.utente = ‘enrico’)
2020-07-10 10:53:20,234 TRACE [main]: (AbstractFlushingEventListener.java:67) AbstractFlushingEventListener - Flushing session
2020-07-10 10:53:20,238 DEBUG [main]: (AbstractFlushingEventListener.java:132) AbstractFlushingEventListener - Processing flush-time cascades
2020-07-10 10:53:20,284 DEBUG [main]: (AbstractFlushingEventListener.java:174) AbstractFlushingEventListener - Dirty checking collections
2020-07-10 10:53:20,291 TRACE [main]: (AbstractFlushingEventListener.java:189) AbstractFlushingEventListener - Flushing entities and processing referenced collections
2020-07-10 10:53:20,319 TRACE [main]: (AbstractFlushingEventListener.java:232) AbstractFlushingEventListener - Processing unreferenced collections
2020-07-10 10:53:20,320 TRACE [main]: (AbstractFlushingEventListener.java:249) AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
2020-07-10 10:53:20,321 DEBUG [main]: (AbstractFlushingEventListener.java:106) AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects
2020-07-10 10:53:20,326 DEBUG [main]: (AbstractFlushingEventListener.java:113) AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2020-07-10 10:53:20,328 DEBUG [main]: (EntityPrinter.java:102) EntityPrinter - Listing entities:
2020-07-10 10:53:20,343 DEBUG [main]: (EntityPrinter.java:109) EntityPrinter - elettrica.jelettrixbase.database.Parametri{amazonLeadtime=1, epriceLeadtime=1, ebayTokenExpirationTime=2021-05-29T00:00, ebayLeadtime=1, aribaLeadtime=10, elergyProduction=1, version=1.2c1, cdiscountLeadtime=1, varianteRame2=369.54100, updateurl=file:\\192.168.90.2\install\Elettrica\jelettrix.zip, ebayToken=AgAAAAAQAAAAaAAAAA1RbqXQnY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AHkYWlCJKBqQWdj6x9nY+seQSqACAAAAMAAA**3hEPF4eWHCgNQ/y5Il0riDz1a4lz/DCrIErmBJ3BFL7cj5rLdofNJNITIZbrR8fl2TOdFjo17JTXlE7f5HcSdZ4IahjNITEjyihXJmcY7XUJwtIy6tcWLgNv840mCKfS9yNn+QujecalnZZsiGMpG5x0g2ukZ3zSeDPsxpHlkraqMLRnhyynpWy/tcKekgbzASCzCO4cIjGpKODqDDWJ6k3oJiFxWJWfgJavjqSeqrM5seK4qQwOWao0qm1dc0YnR1fxcKGvPsp7hJ7FGAkQzdgxL7iiaFD91MUl09Wka03NGQFWidtIkPo9P1sbWmytDH7s1fNwviwzp87Ebbj9vr7pM7XTAvzGtaaKMNWGB9YiX9xxkWzsTOp2e6mVEyoVxHDBdwPwmoDcjf806riYFFUTnP5B4ZmpoSmDjewzlMWcISDMCJnXrNu2Nr7rlosRWYlPqmaPEoJSa6Uqk/yzei7guR/gcVN0QpMl2IDPtJSpdlql+C4WWiMFFAybSDy6LQep7R24aIBNYLO5v6bPDcfk1V5AdTBCYMQjZOMgwOBslw96e4W3KlhlMpkv/Exl4jGGvSYjMvVfDHERcDdNSxpD3FLP/oflElQu6K3mhEqBNcRtqELvFw+PG64hKK+OXk1GlWFN7MfmGx4FM39hJNbOrR2oBlvLQr0oOQEKLXXpxwDH+D7NJ1qCtx6Es794620Is4FKLojwRH8VL9evrPvIQBuf6nokP1LgDkKImroUYHGRPWxwORN76RhNSsrs, mailsmtp=posta.lelettrica.it, mailpop=posta.lelettrica.it, manomanoLeadtime=1}
2020-07-10 10:53:20,349 TRACE [main]: (DefaultAutoFlushEventListener.java:60) DefaultAutoFlushEventListener - Don’t need to execute flush
2020-07-10 10:53:20,357 TRACE [main]: (HQLQueryPlan.java:193) HQLQueryPlan - Find: FROM Utenti as u where u.utente = ‘enrico’
2020-07-10 10:53:20,360 TRACE [main]: (QueryParameters.java:324) QueryParameters - Named parameters: {}
2020-07-10 10:53:20,362 DEBUG [main]: (SqlStatementLogger.java:92) SQL - select utenti0_.UTENTE as UTENTE1_65_, utenti0_.ABILITATO as ABILITAT2_65_, utenti0_.AGGFOLDER as AGGFOLDE3_65_, utenti0_.AGGPASSWORD as AGGPASSW4_65_, utenti0_.AGGUSER as AGGUSER5_65_, utenti0_.DESCRIZIONE as DESCRIZI6_65_, utenti0_.GRUPPO as GRUPPO7_65_, utenti0_.IP as IP8_65_, utenti0_.LABEL_PRINTER_NAME as LABEL_PR9_65_, utenti0_.MAILADDRESS as MAILADD10_65_, utenti0_.MAILPASSWORD as MAILPAS11_65_, utenti0_.MAILPOP as MAILPOP12_65_, utenti0_.MAILSMTP as MAILSMT13_65_, utenti0_.MAILUSER as MAILUSE14_65_, utenti0_.PASSWORD as PASSWOR15_65_, utenti0_.PRINTER_SERVER as PRINTER16_65_, utenti0_.REPARTO as REPARTO17_65_, utenti0_.RFIL as RFIL18_65_, utenti0_.UTENTE_ELETTRIX as UTENTE_19_65_ from UTENTI utenti0_ where utenti0_.UTENTE=‘enrico’
2020-07-10 10:53:20,397 TRACE [main]: (ResourceRegistryStandardImpl.java:55) ResourceRegistryStandardImpl - Registering statement [SQLServerPreparedStatement:5]
2020-07-10 10:53:20,400 TRACE [main]: (JdbcCoordinatorImpl.java:333) JdbcCoordinatorImpl - Registering last query statement [SQLServerPreparedStatement:5]
2020-07-10 10:53:20,401 TRACE [main]: (Loader.java:1990) Loader - Bound [1] parameters total