Bug #76426 Timestamp not supported in Fabric driver. It gives null pointer error in server
Submitted: 21 Mar 2015 15:17 Modified: 3 May 2015 16:29
Reporter: Manish chauthani Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:Redhat Enteriprise Linux 6.5 OS:Linux
Assigned to: Assigned Account CPU Architecture:Any
Tags: Mysql Fabric

[21 Mar 2015 15:17] Manish chauthani
Description:

If we provide @Temporal(TemporalType.TIMESTAMP)
  private java.util.Calendar dob;
In the entity, We will not be able to insert row in the database.

Please provide me the reason why this is happening?

Date is ok but timestamp seems to have issues.

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class XXXX {
  @Id
  private String id;

  private String name;
  @Temporal(TemporalType.TIMESTAMP)
  private java.util.Calendar dob;

  

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public java.util.Calendar getDob() {
    return dob;
  }

  public void setDob(java.util.Calendar dob) {
    this.dob = dob;
  }

  public String toString() {
    return "\n\nID:" + id + "\nName:" + name + "\n\n"+"Dob"+dob;
  }
} 

How to repeat:

Just create any entity with timestamp field. Use fabric driver and once table is created by JPA/hibernate try to insert a row. you will be able to replicate this issue.

 with @Temporal(TemporalType.TIMESTAMP)
  private java.util.Calendar dob;

Suggested fix:

Use Date instead of timestamp to fix the issue. 

I struggled for 3 weeks to check what is going wrong. Error log does not give any hint of the problem. I had to myself dig down and explore.

Please provide me reasons why farbic is not accepting timestamp.

I have tried all possible permutations combinations to insert timestamp but failed.
[30 Mar 2015 21:19] Jess Balint
Please test with Connector/J 5.1.35. This should be a duplicate of Bug#75080.
[4 May 2015 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".