You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Simone Gianni (JIRA)" <ji...@apache.org> on 2008/10/08 00:16:45 UTC

[jira] Created: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
----------------------------------------------------------------------------------------

                 Key: OPENJPA-740
                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
             Project: OpenJPA
          Issue Type: Improvement
          Components: sql
    Affects Versions: 1.2.0
            Reporter: Simone Gianni


When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.

Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.

I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.

The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.

Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by Michael Dick <mi...@gmail.com>.
Hi Simone,

It's probably more than you need, but you can take a look at
TestPrecisionMapping [1] which was added under issue OPENJPA-213 [2].

It works backwards from an entity and determines what type the columns are
mapped to so you'll need an entity which has a blob attribute. AllFieldTypes
[3] or AnnoTest1[4] should work in a pinch though. Let me know if you have
any questions.

-mike

[1]
http://fisheye6.atlassian.com/browse/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/mapping/TestPrecisionMapping.java?r=658197
[2] http://issues.apache.org/jira/browse/OPENJPA-213
[3]
http://fisheye6.atlassian.com/browse/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/AllFieldTypes.java?r=612345
[4]
http://fisheye6.atlassian.com/browse/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/AnnoTest1.java?r=590529



On Mon, Oct 27, 2008 at 9:46 AM, Simone Gianni <si...@apache.org> wrote:

> Hi all,
> no one answered so I'm asking again ...
>
> I patched MySQLDictionary to return LONGBLOB etc.. I'd like to test it
> out, but searching in JUnit tests cannot find a test that generates a
> schema and checks it. Can anyone point me to it?
>
> Simone
>
> Michael Dick wrote:
> > Hi Simone,
> >
> > Patch submissions are always welcome :-), but there is a fairly simple
> > workaround.
> >
> > All (or nearly all) the DBDictionary attributes can be changed in your
> > configuration. You should be able to work around this problem by adding
> the
> > following to persistence.xml :
> > <property name="openjpa.jdbc.*DBDictionary*"
> > value="mysql(blobTypeName=MEDIUMBLOB)" />
> >
> > I haven't tested it out, I'll try to take a closer look tonight or
> tomorrow
> > morning.
> >
> > Best Regards,
> >
> > -mike
> >
> > On Tue, Oct 7, 2008 at 5:26 PM, Simone Gianni <si...@apache.org>
> wrote:
> >
> >
> >> Hi all,
> >> I can try to patch the code and provide a patch by myself, I'd just like
> >> to know if this bug is "real" or if I'm missing some important
> >> workaround that would make this bug (and the patch) useless.
> >>
> >>
> >> Thanks,
> >> Simone
> >>
> >> Simone Gianni (JIRA) wrote:
> >>
> >>> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only
> >>>
> >> holds 64kb of data.
> >>
> >>
> ----------------------------------------------------------------------------------------
> >>
> >>>                  Key: OPENJPA-740
> >>>                  URL:
> https://issues.apache.org/jira/browse/OPENJPA-740
> >>>              Project: OpenJPA
> >>>           Issue Type: Improvement
> >>>           Components: sql
> >>>     Affects Versions: 1.2.0
> >>>             Reporter: Simone Gianni
> >>>
> >>>
> >>> When a column is annotated as a BLOB of using @Persistent to use
> >>>
> >> streaming blobs, and the underlying database is MySQL, OpenJPA will
> create a
> >> column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a
> (vary)
> >> limited amount of data, while (especially when using streaming blobs)
> the
> >> user would probably expect it to hold a large amount of data.
> >>
> >>> Also adding the @Column annotation and specifying a size bigger than
> what
> >>>
> >> a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB
> column.
> >>
> >>> I think OpenJPA should be able to create the proper column type
> depending
> >>>
> >> on the @Column annotation if present, or otherwise default at least to a
> >> MEDIUMBLOB to preserve cross-database compatibility as expected.
> >>
> >>> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB"
> in
> >>>
> >> the MySQLDictionary constructor.
> >>
> >>> Otherwise, overriding the getTypeName to properly parse the length and
> >>>
> >> return the correct BLOB/TEXT type for mysql.
> >>
> >>>
> >> --
> >> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
> >> MALE human being programming a computer   http://www.simonegianni.it/
> >>
> >>
> >>
> >
> >
>
>
> --
> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
> MALE human being programming a computer   http://www.simonegianni.it/
>
>

Re: [jira] Created: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by Simone Gianni <si...@apache.org>.
Hi all,
no one answered so I'm asking again ...

I patched MySQLDictionary to return LONGBLOB etc.. I'd like to test it
out, but searching in JUnit tests cannot find a test that generates a
schema and checks it. Can anyone point me to it?

Simone

Michael Dick wrote:
> Hi Simone,
>
> Patch submissions are always welcome :-), but there is a fairly simple
> workaround.
>
> All (or nearly all) the DBDictionary attributes can be changed in your
> configuration. You should be able to work around this problem by adding the
> following to persistence.xml :
> <property name="openjpa.jdbc.*DBDictionary*"
> value="mysql(blobTypeName=MEDIUMBLOB)" />
>
> I haven't tested it out, I'll try to take a closer look tonight or tomorrow
> morning.
>
> Best Regards,
>
> -mike
>
> On Tue, Oct 7, 2008 at 5:26 PM, Simone Gianni <si...@apache.org> wrote:
>
>   
>> Hi all,
>> I can try to patch the code and provide a patch by myself, I'd just like
>> to know if this bug is "real" or if I'm missing some important
>> workaround that would make this bug (and the patch) useless.
>>
>>
>> Thanks,
>> Simone
>>
>> Simone Gianni (JIRA) wrote:
>>     
>>> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only
>>>       
>> holds 64kb of data.
>>     
>> ----------------------------------------------------------------------------------------
>>     
>>>                  Key: OPENJPA-740
>>>                  URL: https://issues.apache.org/jira/browse/OPENJPA-740
>>>              Project: OpenJPA
>>>           Issue Type: Improvement
>>>           Components: sql
>>>     Affects Versions: 1.2.0
>>>             Reporter: Simone Gianni
>>>
>>>
>>> When a column is annotated as a BLOB of using @Persistent to use
>>>       
>> streaming blobs, and the underlying database is MySQL, OpenJPA will create a
>> column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary)
>> limited amount of data, while (especially when using streaming blobs) the
>> user would probably expect it to hold a large amount of data.
>>     
>>> Also adding the @Column annotation and specifying a size bigger than what
>>>       
>> a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
>>     
>>> I think OpenJPA should be able to create the proper column type depending
>>>       
>> on the @Column annotation if present, or otherwise default at least to a
>> MEDIUMBLOB to preserve cross-database compatibility as expected.
>>     
>>> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in
>>>       
>> the MySQLDictionary constructor.
>>     
>>> Otherwise, overriding the getTypeName to properly parse the length and
>>>       
>> return the correct BLOB/TEXT type for mysql.
>>     
>>>       
>> --
>> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
>> MALE human being programming a computer   http://www.simonegianni.it/
>>
>>
>>     
>
>   


-- 
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
MALE human being programming a computer   http://www.simonegianni.it/


Re: [jira] Created: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by Michael Dick <mi...@gmail.com>.
Hi Simone,

My first instinct was to point to the mapping guidelines provided for JDBC
[1]. Then I realized how small a MySQL BLOB really is [2] and
now I agree. MEDIUMBLOB seems like a good compromise for MySQL. It's really
just a matter of changing the blobTypeName variable in MySQLDictionary.java,
if you want to submit a patch feel free, otherwise I'm happy to make the
change.

-mike

[1] http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html
[2] http://dev.mysql.com/doc/refman/6.0/en/storage-requirements.html


On Tue, Oct 7, 2008 at 6:22 PM, Simone Gianni <si...@apache.org> wrote:

> Hi Michael,
> yes, I worked it around that way, but still think this is somehow a bug.
> I'll try to patch the MySQLDictionary to generate proper (read: mysql
> non-standard) column types based on the length when it comes to
> TEXT/CLOB/BLOB. I think I can find time to do it on Thursday.
>
> Thanks,
> Simone
>
> Michael Dick wrote:
> > Hi Simone,
> >
> > Patch submissions are always welcome :-), but there is a fairly simple
> > workaround.
> >
> > All (or nearly all) the DBDictionary attributes can be changed in your
> > configuration. You should be able to work around this problem by adding
> the
> > following to persistence.xml :
> > <property name="openjpa.jdbc.*DBDictionary*"
> > value="mysql(blobTypeName=MEDIUMBLOB)" />
> >
> > I haven't tested it out, I'll try to take a closer look tonight or
> tomorrow
> > morning.
> >
> > Best Regards,
> >
> > -mike
> >
> > On Tue, Oct 7, 2008 at 5:26 PM, Simone Gianni <si...@apache.org>
> wrote:
> >
> >
> >> Hi all,
> >> I can try to patch the code and provide a patch by myself, I'd just like
> >> to know if this bug is "real" or if I'm missing some important
> >> workaround that would make this bug (and the patch) useless.
> >>
> >>
> >> Thanks,
> >> Simone
> >>
> >> Simone Gianni (JIRA) wrote:
> >>
> >>> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only
> >>>
> >> holds 64kb of data.
> >>
> >>
> ----------------------------------------------------------------------------------------
> >>
> >>>                  Key: OPENJPA-740
> >>>                  URL:
> https://issues.apache.org/jira/browse/OPENJPA-740
> >>>              Project: OpenJPA
> >>>           Issue Type: Improvement
> >>>           Components: sql
> >>>     Affects Versions: 1.2.0
> >>>             Reporter: Simone Gianni
> >>>
> >>>
> >>> When a column is annotated as a BLOB of using @Persistent to use
> >>>
> >> streaming blobs, and the underlying database is MySQL, OpenJPA will
> create a
> >> column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a
> (vary)
> >> limited amount of data, while (especially when using streaming blobs)
> the
> >> user would probably expect it to hold a large amount of data.
> >>
> >>> Also adding the @Column annotation and specifying a size bigger than
> what
> >>>
> >> a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB
> column.
> >>
> >>> I think OpenJPA should be able to create the proper column type
> depending
> >>>
> >> on the @Column annotation if present, or otherwise default at least to a
> >> MEDIUMBLOB to preserve cross-database compatibility as expected.
> >>
> >>> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB"
> in
> >>>
> >> the MySQLDictionary constructor.
> >>
> >>> Otherwise, overriding the getTypeName to properly parse the length and
> >>>
> >> return the correct BLOB/TEXT type for mysql.
> >>
> >>>
> >> --
> >> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
> >> MALE human being programming a computer   http://www.simonegianni.it/
> >>
> >>
> >>
> >
> >
>
>
> --
> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
> MALE human being programming a computer   http://www.simonegianni.it/
>
>

Re: [jira] Created: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by Simone Gianni <si...@apache.org>.
Hi Michael,
yes, I worked it around that way, but still think this is somehow a bug.
I'll try to patch the MySQLDictionary to generate proper (read: mysql
non-standard) column types based on the length when it comes to
TEXT/CLOB/BLOB. I think I can find time to do it on Thursday.

Thanks,
Simone

Michael Dick wrote:
> Hi Simone,
>
> Patch submissions are always welcome :-), but there is a fairly simple
> workaround.
>
> All (or nearly all) the DBDictionary attributes can be changed in your
> configuration. You should be able to work around this problem by adding the
> following to persistence.xml :
> <property name="openjpa.jdbc.*DBDictionary*"
> value="mysql(blobTypeName=MEDIUMBLOB)" />
>
> I haven't tested it out, I'll try to take a closer look tonight or tomorrow
> morning.
>
> Best Regards,
>
> -mike
>
> On Tue, Oct 7, 2008 at 5:26 PM, Simone Gianni <si...@apache.org> wrote:
>
>   
>> Hi all,
>> I can try to patch the code and provide a patch by myself, I'd just like
>> to know if this bug is "real" or if I'm missing some important
>> workaround that would make this bug (and the patch) useless.
>>
>>
>> Thanks,
>> Simone
>>
>> Simone Gianni (JIRA) wrote:
>>     
>>> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only
>>>       
>> holds 64kb of data.
>>     
>> ----------------------------------------------------------------------------------------
>>     
>>>                  Key: OPENJPA-740
>>>                  URL: https://issues.apache.org/jira/browse/OPENJPA-740
>>>              Project: OpenJPA
>>>           Issue Type: Improvement
>>>           Components: sql
>>>     Affects Versions: 1.2.0
>>>             Reporter: Simone Gianni
>>>
>>>
>>> When a column is annotated as a BLOB of using @Persistent to use
>>>       
>> streaming blobs, and the underlying database is MySQL, OpenJPA will create a
>> column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary)
>> limited amount of data, while (especially when using streaming blobs) the
>> user would probably expect it to hold a large amount of data.
>>     
>>> Also adding the @Column annotation and specifying a size bigger than what
>>>       
>> a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
>>     
>>> I think OpenJPA should be able to create the proper column type depending
>>>       
>> on the @Column annotation if present, or otherwise default at least to a
>> MEDIUMBLOB to preserve cross-database compatibility as expected.
>>     
>>> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in
>>>       
>> the MySQLDictionary constructor.
>>     
>>> Otherwise, overriding the getTypeName to properly parse the length and
>>>       
>> return the correct BLOB/TEXT type for mysql.
>>     
>>>       
>> --
>> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
>> MALE human being programming a computer   http://www.simonegianni.it/
>>
>>
>>     
>
>   


-- 
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
MALE human being programming a computer   http://www.simonegianni.it/


Re: [jira] Created: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by Simone Gianni <si...@apache.org>.
Hi all,
I patched MySQLDictionary to return LONGBLOB etc.. I'd like to test it
out, but searching in junit tests cannot find a test that generates a
schema and checks it. Can anyone point me to it?

Simone

Michael Dick wrote:
> Hi Simone,
>
> Patch submissions are always welcome :-), but there is a fairly simple
> workaround.
>
> All (or nearly all) the DBDictionary attributes can be changed in your
> configuration. You should be able to work around this problem by adding the
> following to persistence.xml :
> <property name="openjpa.jdbc.*DBDictionary*"
> value="mysql(blobTypeName=MEDIUMBLOB)" />
>
> I haven't tested it out, I'll try to take a closer look tonight or tomorrow
> morning.
>
> Best Regards,
>
> -mike
>
> On Tue, Oct 7, 2008 at 5:26 PM, Simone Gianni <si...@apache.org> wrote:
>
>   
>> Hi all,
>> I can try to patch the code and provide a patch by myself, I'd just like
>> to know if this bug is "real" or if I'm missing some important
>> workaround that would make this bug (and the patch) useless.
>>
>>
>> Thanks,
>> Simone
>>
>> Simone Gianni (JIRA) wrote:
>>     
>>> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only
>>>       
>> holds 64kb of data.
>>     
>> ----------------------------------------------------------------------------------------
>>     
>>>                  Key: OPENJPA-740
>>>                  URL: https://issues.apache.org/jira/browse/OPENJPA-740
>>>              Project: OpenJPA
>>>           Issue Type: Improvement
>>>           Components: sql
>>>     Affects Versions: 1.2.0
>>>             Reporter: Simone Gianni
>>>
>>>
>>> When a column is annotated as a BLOB of using @Persistent to use
>>>       
>> streaming blobs, and the underlying database is MySQL, OpenJPA will create a
>> column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary)
>> limited amount of data, while (especially when using streaming blobs) the
>> user would probably expect it to hold a large amount of data.
>>     
>>> Also adding the @Column annotation and specifying a size bigger than what
>>>       
>> a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
>>     
>>> I think OpenJPA should be able to create the proper column type depending
>>>       
>> on the @Column annotation if present, or otherwise default at least to a
>> MEDIUMBLOB to preserve cross-database compatibility as expected.
>>     
>>> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in
>>>       
>> the MySQLDictionary constructor.
>>     
>>> Otherwise, overriding the getTypeName to properly parse the length and
>>>       
>> return the correct BLOB/TEXT type for mysql.
>>     
>>>       
>> --
>> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
>> MALE human being programming a computer   http://www.simonegianni.it/
>>
>>
>>     
>
>   


-- 
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
MALE human being programming a computer   http://www.simonegianni.it/


Re: [jira] Created: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by Michael Dick <mi...@gmail.com>.
Hi Simone,

Patch submissions are always welcome :-), but there is a fairly simple
workaround.

All (or nearly all) the DBDictionary attributes can be changed in your
configuration. You should be able to work around this problem by adding the
following to persistence.xml :
<property name="openjpa.jdbc.*DBDictionary*"
value="mysql(blobTypeName=MEDIUMBLOB)" />

I haven't tested it out, I'll try to take a closer look tonight or tomorrow
morning.

Best Regards,

-mike

On Tue, Oct 7, 2008 at 5:26 PM, Simone Gianni <si...@apache.org> wrote:

> Hi all,
> I can try to patch the code and provide a patch by myself, I'd just like
> to know if this bug is "real" or if I'm missing some important
> workaround that would make this bug (and the patch) useless.
>
>
> Thanks,
> Simone
>
> Simone Gianni (JIRA) wrote:
> > In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only
> holds 64kb of data.
> >
> ----------------------------------------------------------------------------------------
> >
> >                  Key: OPENJPA-740
> >                  URL: https://issues.apache.org/jira/browse/OPENJPA-740
> >              Project: OpenJPA
> >           Issue Type: Improvement
> >           Components: sql
> >     Affects Versions: 1.2.0
> >             Reporter: Simone Gianni
> >
> >
> > When a column is annotated as a BLOB of using @Persistent to use
> streaming blobs, and the underlying database is MySQL, OpenJPA will create a
> column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary)
> limited amount of data, while (especially when using streaming blobs) the
> user would probably expect it to hold a large amount of data.
> >
> > Also adding the @Column annotation and specifying a size bigger than what
> a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> >
> > I think OpenJPA should be able to create the proper column type depending
> on the @Column annotation if present, or otherwise default at least to a
> MEDIUMBLOB to preserve cross-database compatibility as expected.
> >
> > The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in
> the MySQLDictionary constructor.
> >
> > Otherwise, overriding the getTypeName to properly parse the length and
> return the correct BLOB/TEXT type for mysql.
> >
> >
>
>
> --
> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
> MALE human being programming a computer   http://www.simonegianni.it/
>
>

Re: [jira] Created: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by Simone Gianni <si...@apache.org>.
Hi all,
I can try to patch the code and provide a patch by myself, I'd just like
to know if this bug is "real" or if I'm missing some important
workaround that would make this bug (and the patch) useless.


Thanks,
Simone

Simone Gianni (JIRA) wrote:
> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                  Key: OPENJPA-740
>                  URL: https://issues.apache.org/jira/browse/OPENJPA-740
>              Project: OpenJPA
>           Issue Type: Improvement
>           Components: sql
>     Affects Versions: 1.2.0
>             Reporter: Simone Gianni
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
>
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
>
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
>
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
>
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.
>
>   


-- 
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
MALE human being programming a computer   http://www.simonegianni.it/


[jira] Updated: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Simone Gianni (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Gianni updated OPENJPA-740:
----------------------------------

    Attachment: OPENJPA-740-mysqlblob.patch

This patchs uses the right column table for mysql based on the size specified for the column. I had this patch for a few months now, but no one told me how to test it in junit, so unfortunately I haven't provided a junit test case for it.

Sice this patch is old, I don't know if it still applies to recent OpenJPA versions. If I have time to, I'll do a fresh checkout and test it.

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: sql
>    Affects Versions: 1.2.0
>            Reporter: Simone Gianni
>         Attachments: OPENJPA-740-mysqlblob.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated OPENJPA-740:
---------------------------------

           Patch Info: [Patch Available]
    Affects Version/s: 1.3.0
                       2.0.0-M3
                       2.0.0-beta
                       2.0.0-beta2
        Fix Version/s: 2.0.0
                       1.3.0

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-mysqlblob.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated OPENJPA-740:
---------------------------------

    Attachment:     (was: OPENJPA-740-13x.patch)

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842793#action_12842793 ] 

Milosz Tylenda commented on OPENJPA-740:
----------------------------------------

For those not able to use OpenJPA versions with fix - If only MySQL is being used or separate configurations are used for different databases (i.e. DBDictionary auto-detection is not used), setting the following property in persistence.xml should be a workaround:

<property name="openjpa.jdbc.DBDictionary" value="blobTypeName=LONGBLOB"/>


> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated OPENJPA-740:
---------------------------------

    Attachment: OPENJPA-740-13x.patch
                OPENJPA-740-trunk.patch

Fixed order for col.size() checks to correctly return the type....

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842795#action_12842795 ] 

Milosz Tylenda commented on OPENJPA-740:
----------------------------------------

Donald, just wondering about the patch - will the column type be correct (i.e. equals the type specified in blobTypeName public variable) when the size of the column is not specified?


> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated OPENJPA-740:
---------------------------------

    Attachment:     (was: OPENJPA-740-trunk.patch)

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated OPENJPA-740:
---------------------------------

    Fix Version/s:     (was: 2.0.0)
                   2.0.0-beta3

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0-beta3
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842805#action_12842805 ] 

Donald Woods commented on OPENJPA-740:
--------------------------------------

Thanks Milosz, I just added a check for size==0 so it'll use the old blob size (64KB).
For those cases, users should use your prior comment of overriding the blobTypeName.



> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Norman Maurer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842288#action_12842288 ] 

Norman Maurer commented on OPENJPA-740:
---------------------------------------

Our bugreport listed here is related to it:

https://issues.apache.org/jira/browse/IMAP-114

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2
>            Reporter: Simone Gianni
>            Priority: Blocker
>         Attachments: OPENJPA-740-mysqlblob.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods resolved OPENJPA-740.
----------------------------------

    Resolution: Fixed

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods reassigned OPENJPA-740:
------------------------------------

    Assignee: Donald Woods

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-mysqlblob.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on OPENJPA-740 started by Donald Woods.

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Norman Maurer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer updated OPENJPA-740:
----------------------------------

             Priority: Blocker  (was: Major)
    Affects Version/s: 1.2.1
                       1.2.2
           Issue Type: Bug  (was: Improvement)

The Problem still exists in 1.2.2. And for me its really a blocker !

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2
>            Reporter: Simone Gianni
>            Priority: Blocker
>         Attachments: OPENJPA-740-mysqlblob.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated OPENJPA-740:
---------------------------------

    Attachment: OPENJPA-740-trunk.patch
                OPENJPA-740-13x.patch

Updated 1.3.x and trunk patches to match the latest svn revisions.

> In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data.
> ----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-740
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-740
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2
>            Reporter: Simone Gianni
>            Assignee: Donald Woods
>            Priority: Blocker
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch
>
>
> When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data.
> Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column.
> I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected.
> The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor.
> Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.