List:Cluster« Previous MessageNext Message »
From:Serdyn du Toit Date:July 22 2013 9:19pm
Subject:Re: CRUD in MySql general log
View as plain text  
Decided subsequently that having all those getters and setters on every
subclass is not good enough.

Raised a "feature request" and suggested a fix here:
http://bugs.mysql.com/bug.php?id=69815



On Tue, Jul 16, 2013 at 10:37 AM, Serdyn du Toit <dutoitns@stripped> wrote:

> It works :)
> I removed the @MappedSuperclass annotations and just created all the
> getters and setters on the concrete (so the concrete is a bit more verbose,
> but it works)
>
> Many thanks :)
> Serdyn du Toit
>
>
>
> On Tue, Jul 16, 2013 at 2:07 AM, Serdyn du Toit <dutoitns@stripped>wrote:
>
>> Hi,
>>
>> > Can you try to define the persistent classes with no superclasses?
>> Thanks - that resolved the issue (re the general log). I now don't see
>> the inserts and updates in the general log.
>>
>> After reading the tutorials and seeing the Jpa @Entity etcetera
>> annotations I just assumed superclasses (@MappedSuperclass) will be
>> supported.
>>
>> I'm going to play around with the code a bit - I'm going to need to
>> resolve this...somehow...  The superclasses in my class hierarchy
>> automatically log who made the last modification to the current iteration
>> of the object (mini audit trail).
>>
>> @MappedSuperclass
>> public abstract class AbstractDataBean<DATABEAN extends
>> AbstractDataBean<DATABEAN>>
>> extends DataBean<DATABEAN> {
>>    private long adminId = 0;
>>     private int lastEventTypeId = 1; // 1 = create event; 1+ = update
>> event
>>     private java.util.Date createDate = DateUtil.now();
>>     private java.util.Date lastUpdate = createDate;
>>     ...etcetera...
>>
>> Kind regards,
>> Serdyn du Toit
>>
>>
>> On Mon, Jul 15, 2013 at 5:34 PM, Craig L Russell <
>> craig.russell@stripped> wrote:
>>
>>> Hi,
>>>
>>> The big clue is in the log:
>>>
>>> Class class code.TestDataBean is a persistent subclass and is not
>>> supported.;
>>>
>>> Can you try to define the persistent classes with no superclasses?
>>>
>>> Regards,
>>>
>>> Craig
>>>
>>> On Jul 15, 2013, at 2:54 AM, Serdyn du Toit wrote:
>>>
>>> > Hi Craig,
>>> >
>>> >> What I meant is the mysqld that you are using with the clusterjpa
>>> plugin.
>>> > You configure your openjpa with the clusterjpa plugin.
>>> > Aaah, okay - so I shouldn't expect to see clusterj and openjpa when
>>> using
>>> > SHOW PLUGINS, but it should be installed automatically.  (I do see a
>>> few
>>> > ndb plugins)
>>> >
>>> > The only thing I need to configure in OpenJpa is the persistence.xml
>>> right?
>>> > I used OpenJpa 2.2.2, but the same problem is present using the OpenJpa
>>> > 1.3.x branch.
>>> >
>>> > Properties in my persistence.xml are as follows:
>>> >      <!-- MySql Cluster port 5000 -->
>>> >      <property name="openjpa.jdbc.SynchronizeMappings"
>>> value="buildSchema"
>>> > />
>>> >      <property name="openjpa.ConnectionDriverName"
>>> > value="com.mysql.jdbc.Driver" />
>>> >      <property name="openjpa.ConnectionURL"
>>> > value="jdbc:mysql://localhost:5000/clusterdb" />
>>> >      <property name="openjpa.ConnectionUserName" value="root" />
>>> >      <property name="openjpa.ConnectionPassword" value="" />
>>> >      <property name="openjpa.BrokerFactory" value="ndb" />
>>> >      <property name="openjpa.jdbc.DBDictionary"
> value="TableType=ndb"
>>> />
>>> >      <property name="openjpa.ndb.connectString"
> value="localhost:1186"
>>> />
>>> >      <property name="openjpa.ndb.database" value="clusterdb" />
>>> >      <property name="openjpa.Log" value="DefaultLevel=TRACE" />
>>> >
>>> > My table does use the ndbcluster engine:
>>> > CREATE TABLE `testdatabean` (
>>> >  `id` bigint(20) NOT NULL,
>>> >  `createDate` datetime DEFAULT NULL,
>>> >  `lastEventTypeId` int(11) DEFAULT NULL,
>>> >  `lastUpdate` datetime DEFAULT NULL,
>>> >  `firstName` varchar(255) DEFAULT NULL,
>>> >  `lastName` varchar(255) DEFAULT NULL,
>>> >  PRIMARY KEY (`id`)
>>> > ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
>>> >
>>> > I enabled and used the general log as follows:
>>> > SET global general_log = 1;
>>> > SET global log_output = 'table';
>>> > select * from mysql.general_log;
>>> >
>>> > Some entries from the general log:
>>> > | 2013-07-15 11:40:38 | root[root] @ localhost [127.0.0.1] |        34
>>> |
>>> > 0 | Query        | INSERT INTO TestDataBean (id, createDate,
>>> > lastEventTypeId, l
>>> > astUpdate, firstName, lastName) VALUES (100, '2013-07-15
>>> 11:40:38.335', 1,
>>> > '2013
>>> > -07-15 11:40:38.335', 'testFirstName', 'testLastName')
>>> > | 2013-07-15 11:40:38 | root[root] @ localhost [127.0.0.1] |        34
>>> |
>>> > 0 | Query        | UPDATE TestDataBean SET firstName = 'MODIFIED-Mon
>>> Jul
>>> > 15 11:
>>> > 40:38 CAT 2013' WHERE id = 100
>>> >
>>> > Java stacktrace with OpenJpa loglevel TRACE:
>>> http://pastebin.com/JaP9dL7s
>>> >
>>> > Kind regards,
>>> > Serdyn du Toit
>>> >
>>> >
>>> > On Mon, Jul 15, 2013 at 7:34 AM, Craig L Russell <
>>> craig.russell@stripped>
>>> > wrote:
>>> >
>>> > Sorry if I was not clear.
>>> >
>>> > You don't build mysqld with the clusterjpa plugin.
>>> >
>>> > What I meant is the mysqld that you are using with the clusterjpa
>>> plugin.
>>> > You configure your openjpa with the clusterjpa plugin.
>>> >
>>> > Regards,
>>> >
>>> > Craig
>>>
>>> Craig L Russell
>>> Architect, Oracle
>>> http://db.apache.org/jdo
>>> 408 276-5638 mailto:Craig.Russell@stripped
>>> P.S. A good JDO? O, Gasp!
>>>
>>>
>>
>

Thread
CRUD in MySql general logSerdyn du Toit14 Jul
  • Re: CRUD in MySql general logSerdyn du Toit14 Jul
    • Re: CRUD in MySql general logCraig L Russell14 Jul
      • Re: CRUD in MySql general logSerdyn du Toit15 Jul
        • Re: CRUD in MySql general logCraig L Russell15 Jul
          • Re: CRUD in MySql general logSerdyn du Toit15 Jul
            • Re: CRUD in MySql general logSerdyn du Toit19 Jul
              • Re: CRUD in MySql general logSerdyn du Toit22 Jul
              • Re: CRUD in MySql general logCraig L Russell20 Aug
  • Re: CRUD in MySql general logCraig L Russell14 Jul
    • Re: CRUD in MySql general logSerdyn du Toit14 Jul
      • Re: CRUD in MySql general logSerdyn du Toit15 Jul
        • Re: CRUD in MySql general logCraig L Russell15 Jul
          • Re: CRUD in MySql general logSerdyn du Toit16 Jul
            • Re: CRUD in MySql general logSerdyn du Toit16 Jul
              • Re: CRUD in MySql general logSerdyn du Toit22 Jul
                • Re: CRUD in MySql general logCraig L Russell23 Jul
                  • Re: CRUD in MySql general logSerdyn du Toit23 Jul
                    • Re: CRUD in MySql general logSerdyn du Toit23 Jul