[Maria-discuss] MariaDbConnector 1.x -> 2.6, problem updating/inserting Torque objects
We are about to update MariaDbConnector from 1.x to 2.6. Having a lot of legacy code we (still) make use of Apache Torque (and Village 1.5.3) "on top" of the connector. Option(s) we had to activate so far was/is: useOldAliasMetadataBehavior=true Problem: Updating/inserting (Torque objects) Records does not work anymore with the new connector. Debugging reveals that it is due to the resultSetConcurrency being CONCUR_READ_ONLY when trying to update/insert a Record. Torque seems to initially select the Record to be updated before effetively updating. Hence the Schema "attached" to the record has CONCUR_READ_ONLY
record.schema().column(i).readOnly() // true ☹
I could patch org.mariadb.jdbc.internal.com.read.resultset. SelectResultSet# getMetaData to return
new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, false ) instead of new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, true ) but that doesn't really feel "right" 😉
I'd appreciate any hint/advice regarding this issue Thx Clemens
On 7/21/20 6:39 AM, Clemens Wyss - MySign AG wrote:
I could patch org.mariadb.jdbc.internal.com.read.resultset. SelectResultSet# getMetaData to return
new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, false ) instead of new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, true ) but that doesn't really feel "right" 😉
I agree, that doesn't feel "right" ... yet, a patch could be a reasonable short-term work-around, until a better solution becomes apparent. I would recommend patching such that the boolean value is pulled from a configuration variable if present, otherwise defaults to the current value. In this way, your patch may even be something which you could contribute, as it may turn out to be useful for others. -- Eric Herman mobile:+31 620719662 skype:eric_herman jabber:eric.herman@gmail.com
Hi Eric, first of all: thx for the ultra fast reply
configuration variable we've got the options "at hand". Hence we could add "enforceUpdatableResultSet" (per default false) to Options and then new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, options.enforceUpdatableResultSet )
Still feels like a very "localized solution" -----Ursprüngliche Nachricht----- Von: Eric Herman <eric.herman@gmail.com> Gesendet: Dienstag, 21. Juli 2020 07:43 An: Clemens Wyss - MySign AG <clemens.wyss@mysign.ch>; maria-discuss@lists.launchpad.net Betreff: Re: [Maria-discuss] MariaDbConnector 1.x -> 2.6, problem updating/inserting Torque objects On 7/21/20 6:39 AM, Clemens Wyss - MySign AG wrote:
I could patch org.mariadb.jdbc.internal.com.read.resultset. SelectResultSet# getMetaData to return
new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, false ) instead of new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, true ) but that doesn't really feel "right" 😉
I agree, that doesn't feel "right" ... yet, a patch could be a reasonable short-term work-around, until a better solution becomes apparent. I would recommend patching such that the boolean value is pulled from a configuration variable if present, otherwise defaults to the current value. In this way, your patch may even be something which you could contribute, as it may turn out to be useful for others. -- Eric Herman mobile:+31 620719662 skype:eric_herman jabber:eric.herman@gmail.com
Hi, could you create a JIRA issue for that on https://jira.mariadb.org/browse/CONJ ? JDBC state that https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/ResultS...) Indicates whether the designated column is definitely not writable. Driver indicate that resultset not an updatable resultset. Feel more like a bug Correction on "internal" classes is not a solution. On Tue, Jul 21, 2020 at 3:52 PM Clemens Wyss - MySign AG < clemens.wyss@mysign.ch> wrote:
Hi Eric, first of all: thx for the ultra fast reply
configuration variable we've got the options "at hand". Hence we could add "enforceUpdatableResultSet" (per default false) to Options and then new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, options.enforceUpdatableResultSet )
Still feels like a very "localized solution"
-----Ursprüngliche Nachricht----- Von: Eric Herman <eric.herman@gmail.com> Gesendet: Dienstag, 21. Juli 2020 07:43 An: Clemens Wyss - MySign AG <clemens.wyss@mysign.ch>; maria-discuss@lists.launchpad.net Betreff: Re: [Maria-discuss] MariaDbConnector 1.x -> 2.6, problem updating/inserting Torque objects
On 7/21/20 6:39 AM, Clemens Wyss - MySign AG wrote:
I could patch org.mariadb.jdbc.internal.com.read.resultset. SelectResultSet# getMetaData to return
new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, false ) instead of new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, true ) but that doesn't really feel "right" 😉
I agree, that doesn't feel "right" ... yet, a patch could be a reasonable short-term work-around, until a better solution becomes apparent.
I would recommend patching such that the boolean value is pulled from a configuration variable if present, otherwise defaults to the current value. In this way, your patch may even be something which you could contribute, as it may turn out to be useful for others.
-- Eric Herman mobile:+31 620719662 skype:eric_herman jabber:eric.herman@gmail.com _______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
-- Diego Dupin, Connector team
Correction on "internal" classes is not a solution agree
could you create a JIRA issue https://jira.mariadb.org/browse/CONJ-809 pls feel free to clarify the issue
Von: Diego Dupin <diego.dupin@mariadb.com> Gesendet: Dienstag, 21. Juli 2020 19:08 An: Clemens Wyss - MySign AG <clemens.wyss@mysign.ch> Cc: Eric Herman <eric.herman@gmail.com>; maria-discuss@lists.launchpad.net Betreff: Re: [Maria-discuss] MariaDbConnector 1.x -> 2.6, problem updating/inserting Torque objects Hi, could you create a JIRA issue for that on https://jira.mariadb.org/browse/CONJ ? JDBC state that https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/ResultS...) Indicates whether the designated column is definitely not writable. Driver indicate that resultset not an updatable resultset. Feel more like a bug Correction on "internal" classes is not a solution. On Tue, Jul 21, 2020 at 3:52 PM Clemens Wyss - MySign AG <clemens.wyss@mysign.ch<mailto:clemens.wyss@mysign.ch>> wrote: Hi Eric, first of all: thx for the ultra fast reply
configuration variable we've got the options "at hand". Hence we could add "enforceUpdatableResultSet" (per default false) to Options and then new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, options.enforceUpdatableResultSet )
Still feels like a very "localized solution" -----Ursprüngliche Nachricht----- Von: Eric Herman <eric.herman@gmail.com<mailto:eric.herman@gmail.com>> Gesendet: Dienstag, 21. Juli 2020 07:43 An: Clemens Wyss - MySign AG <clemens.wyss@mysign.ch<mailto:clemens.wyss@mysign.ch>>; maria-discuss@lists.launchpad.net<mailto:maria-discuss@lists.launchpad.net> Betreff: Re: [Maria-discuss] MariaDbConnector 1.x -> 2.6, problem updating/inserting Torque objects On 7/21/20 6:39 AM, Clemens Wyss - MySign AG wrote:
I could patch org.mariadb.jdbc.internal.com<http://org.mariadb.jdbc.internal.com>.read.resultset. SelectResultSet# getMetaData to return
new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, false ) instead of new MariaDbResultSetMetaData(columnsInformation, options, forceAlias, true ) but that doesn't really feel "right" 😉
I agree, that doesn't feel "right" ... yet, a patch could be a reasonable short-term work-around, until a better solution becomes apparent. I would recommend patching such that the boolean value is pulled from a configuration variable if present, otherwise defaults to the current value. In this way, your patch may even be something which you could contribute, as it may turn out to be useful for others. -- Eric Herman mobile:+31 620719662 skype:eric_herman jabber:eric.herman@gmail.com<mailto:jabber%3Aeric.herman@gmail.com> _______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net<mailto:maria-discuss@lists.launchpad.net> Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp -- Diego Dupin, Connector team
participants (3)
-
Clemens Wyss - MySign AG
-
Diego Dupin
-
Eric Herman