Loading ...
Sorry, an error occurred while loading the content.

Jaybird and XWiki

Expand Messages
  • Mark Rotteveel
    I had a look at getting XWiki to run on Firebird, and with some minor changes to the hbm.xml files, an improved Dialect and unfortunately a change to Jaybird
    Message 1 of 8 , Nov 3, 2012
    • 0 Attachment
      I had a look at getting XWiki to run on Firebird, and with some minor
      changes to the hbm.xml files, an improved Dialect and unfortunately a
      change to Jaybird itself I got it running. Most likely the improved
      Dialect is not required, although I need to test that a bit more.

      In the current Jaybird versions there is a bug in the handling of Clobs
      (when the Clob is set using a non-Jaybird Clob (as Hibernate appears to
      do), or with a Reader). See http://tracker.firebirdsql.org/browse/JDBC-281

      I will see if there is a way to get Hibernate to not use the
      get/setClob, but just get/setString instead (as that should be handled
      transparently with Jaybird). Otherwise a new release of Jaybird is
      required to get things to work.

      Mark
      --
      Mark Rotteveel
    • Arioch
      Thank you a lot. No need to hurry now, proper fix is better than fast one :) And what did u mean by Dialect fix ? -- Íàïèñàíî â ïî÷òîâîì
      Message 2 of 8 , Nov 4, 2012
      • 0 Attachment
        Thank you a lot.
        No need to hurry now, proper fix is better than fast one :)

        And what did u mean by "Dialect fix" ?

        --
        �������� � �������� ������� �������� Opera: http://www.opera.com/mail/

        [Non-text portions of this message have been removed]
      • Arioch
        Arioch ïèñàë(à) â ñâî¸ì ïèñüìå Sun, 04 Nov 2012 ... Oh, discard this. You probably meant Hibernate Dialect, set of
        Message 3 of 8 , Nov 4, 2012
        • 0 Attachment
          Arioch <ariochthe@...> �����(�) � ����� ������ Sun, 04 Nov 2012
          20:12:24 +0400:

          > And what did u mean by "Dialect fix" ?

          Oh, discard this.
          You probably meant Hibernate Dialect, set of rules transforming Hibernate
          ORM to SQL

          I mistaken it with Firebird SQL Dialect, and i was very puzzled what's
          wrong with good ol' Dialect 3 :-)))

          [Non-text portions of this message have been removed]
        • Mark Rotteveel
          ... Yes, I meant the hibernate dialect. I first thought part of the problem was the absence of mapping some java.sql.Types entries in the FirebirdDialect
          Message 4 of 8 , Nov 4, 2012
          • 0 Attachment
            On 4-11-2012 17:16, Arioch wrote:
            > Arioch <ariochthe@...> ïèñàë(à) â ñâîžì ïèñüìå Sun, 04 Nov 2012
            > 20:12:24 +0400:
            >
            >> And what did u mean by "Dialect fix" ?
            >
            > Oh, discard this.
            > You probably meant Hibernate Dialect, set of rules transforming Hibernate
            > ORM to SQL

            Yes, I meant the hibernate dialect. I first thought part of the problem
            was the absence of mapping some java.sql.Types entries in the
            FirebirdDialect included in Hibernate, but it probably wasn't.

            > I mistaken it with Firebird SQL Dialect, and i was very puzzled what's
            > wrong with good ol' Dialect 3 :-)))

            :)

            --
            Mark Rotteveel
          • the_a_rioch
            ... Well, i cannot check this, but if they really were missed and inheritance did not worked, then probably adding them would be good thing even if not
            Message 5 of 8 , Nov 6, 2012
            • 0 Attachment
              > Yes, I meant the hibernate dialect. I first thought part of the problem
              > was the absence of mapping some java.sql.Types entries in the
              > FirebirdDialect included in Hibernate, but it probably wasn't.


              Well, i cannot check this, but if they really were missed and inheritance did not worked, then probably adding them would be good thing even if not required for XWiki compatibiltiy

              PS. and i hope u make some notes, that could be published later for other Java programmers that had never before saw FB
            • Mark Rotteveel
              ... Jaybird maps Firebird BLOB and BLOB SUB_TYPE TEXT to java.sql.Types.LONGVARBINARY and LONGVARCHAR (even though you can also access them as a Blob or Clob),
              Message 6 of 8 , Nov 6, 2012
              • 0 Attachment
                On 6-11-2012 13:13, the_a_rioch wrote:
                >
                >> Yes, I meant the hibernate dialect. I first thought part of the problem
                >> was the absence of mapping some java.sql.Types entries in the
                >> FirebirdDialect included in Hibernate, but it probably wasn't.

                > Well, i cannot check this, but if they really were missed and inheritance did not worked, then probably adding them would be good thing even if not required for XWiki compatibiltiy

                Jaybird maps Firebird BLOB and BLOB SUB_TYPE TEXT to
                java.sql.Types.LONGVARBINARY and LONGVARCHAR (even though you can also
                access them as a Blob or Clob), while the dialect included in Hibernate
                maps to java.sql.Types.BLOB and CLOB. It turned out that wasn't the
                problem though.

                It is my intention to release that updated dialect (and to get it
                included in Hibernate), but it still needs some additional work.

                > PS. and i hope u make some notes, that could be published later for other Java programmers that had never before saw FB

                For XWiki it was mostly a matter of changing the mapping of some
                columns: a few to make them fit in combination with character set UTF8.
                With UTF8 you can't have a VARCHAR(8192) column, because to Firebird
                that is 32768 bytes and 32766 bytes is the max for varchar as it also
                needs 2 bytes for the length (or something close to that number). And of
                one table I had to change some columns to make sure the total row size
                did not exceed 64k.

                For now I have changed those simply to a blob, but for those
                VARCHAR(8192) columns I will probably change to VARCHAR(8191) if that
                doesn't make the row too big, and for the table I will try to change
                some of the columns back to the original definition, because blobs
                aren't really efficient.
                --
                Mark Rotteveel
              • mariuz
                ... I need hibernate and firebird for a university project do you have any tips or howto?
                Message 7 of 8 , Nov 29, 2012
                • 0 Attachment
                  On Sat, Nov 03, 2012 at 02:13:09PM +0100, Mark Rotteveel wrote:
                  > I had a look at getting XWiki to run on Firebird, and with some minor
                  > changes to the hbm.xml files, an improved Dialect and unfortunately a
                  > change to Jaybird itself I got it running. Most likely the improved
                  > Dialect is not required, although I need to test that a bit more.
                  >
                  > In the current Jaybird versions there is a bug in the handling of Clobs
                  > (when the Clob is set using a non-Jaybird Clob (as Hibernate appears to
                  > do), or with a Reader). See http://tracker.firebirdsql.org/browse/JDBC-281
                  >
                  > I will see if there is a way to get Hibernate to not use the
                  > get/setClob, but just get/setString instead (as that should be handled
                  > transparently with Jaybird). Otherwise a new release of Jaybird is
                  > required to get things to work.
                  >
                  > Mark

                  I need hibernate and firebird for a university project
                  do you have any tips or howto?
                • Mark Rotteveel
                  ... There is no how-to yet, I have to find the time and energy to write one. As I said, most things will just work, except for Clob as indicated in the email
                  Message 8 of 8 , Dec 1, 2012
                  • 0 Attachment
                    On 29-11-2012 14:12, mariuz wrote:
                    > On Sat, Nov 03, 2012 at 02:13:09PM +0100, Mark Rotteveel wrote:
                    >> I had a look at getting XWiki to run on Firebird, and with some minor
                    >> changes to the hbm.xml files, an improved Dialect and unfortunately a
                    >> change to Jaybird itself I got it running. Most likely the improved
                    >> Dialect is not required, although I need to test that a bit more.
                    >>
                    >> In the current Jaybird versions there is a bug in the handling of Clobs
                    >> (when the Clob is set using a non-Jaybird Clob (as Hibernate appears to
                    >> do), or with a Reader). See http://tracker.firebirdsql.org/browse/JDBC-281
                    >>
                    >> I will see if there is a way to get Hibernate to not use the
                    >> get/setClob, but just get/setString instead (as that should be handled
                    >> transparently with Jaybird). Otherwise a new release of Jaybird is
                    >> required to get things to work.
                    >>
                    >> Mark
                    >
                    > I need hibernate and firebird for a university project
                    > do you have any tips or howto?

                    There is no how-to yet, I have to find the time and energy to write one.
                    As I said, most things will just work, except for Clob as indicated in
                    the email above.

                    Another thing you need to take into account is that the maximum size of
                    one column (except blobs) is 32KB, and 64KB for the entire row

                    For a CHAR column this means the maximum width is 32768 characters when
                    using a single byte character set (eg ISO8859_1), but only 8192 for a
                    UTF8 character set. Firebird unfortunately takes the maximum size of a
                    UTF8 character when deciding the max width, even though the four byte
                    sequences in UTF8 are rarely used. For a VARCHAR column you have two
                    bytes less, so you have 32766 and 8191 characters respectively.

                    Other than that I am currently not aware of other major issues. And even
                    though the current dialect shipped with Hibernate is lacking some
                    features, it will probably be enough for most use cases.

                    If you run into any specific problems, just ask.

                    Mark
                    --
                    Mark Rotteveel
                  Your message has been successfully submitted and would be delivered to recipients shortly.