Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

How to save DateTime to GeoPackage? #516

Open
chunxueer opened this issue Jul 11, 2018 · 0 comments
Open

How to save DateTime to GeoPackage? #516

chunxueer opened this issue Jul 11, 2018 · 0 comments

Comments

@chunxueer
Copy link

How to save DateTime to GeoPackage?

If GeoPackage.gpkg file has filed datatype of DataTime ,will throw exception "Abort due to constraint violation" when saving feature

Hello :
1、When I loaded GeoPackageFeatureTable,try to set a value to filed its datatype is DatatTime,will throw exception "Abort due to constraint violation" 。But use GeodatabaseFeatureTable or ShapefileFeatureTable is ok。
2、The datas of GeoPackage.gpkg file is create by arcgis desktop 10.4 and input from shpfile。
3、Can you tell me the right way of operation ,Thanks!

Running environment : com.esri.arcgisruntime:arcgis-android:100.2.1 and com.esri.arcgisruntime:arcgis-android:100.3.0android 7.1

Code:
`
GregorianCalendar gregorianCalendar =new GregorianCalendar();
gregorianCalendar.setTime(new Date());
feature.getAttributes().put("CREATETIME", gregorianCalendar);
...

ListenableFuture result = geotable.addFeatureAsync(feature);
result.addDoneListener(new Runnable() {
@OverRide
public void run() {
try {
result.get();
} catch (Exception es) {
Log.e(TAG, "",es );
}
}
});
`

Error:
java.util.concurrent.ExecutionException: com.esri.arcgisruntime.ArcGISRuntimeException: Abort due to constraint violation
at com.esri.arcgisruntime.internal.a.b.get(SourceFile:128)
at com.ovit.app.map.custom.MapHelper$4.run(MapHelper.java:494)
at com.esri.arcgisruntime.internal.a.g.b(SourceFile:45)
at com.esri.arcgisruntime.internal.a.e.a(SourceFile:115)
at com.esri.arcgisruntime.internal.a.b.a(SourceFile:174)
at com.esri.arcgisruntime.internal.a.b.a(SourceFile:46)
at com.esri.arcgisruntime.internal.a.b$1.a(SourceFile:53)
at com.esri.arcgisruntime.internal.jni.CoreTask.onTaskCompleted(SourceFile:144)
Caused by: com.esri.arcgisruntime.ArcGISRuntimeException: Abort due to constraint violation
at com.esri.arcgisruntime.internal.a.b.get(SourceFile:120)
at com.ovit.app.map.custom.MapHelper$4.run(MapHelper.java:494)
at com.esri.arcgisruntime.internal.a.g.b(SourceFile:45)
at com.esri.arcgisruntime.internal.a.e.a(SourceFile:115)
at com.esri.arcgisruntime.internal.a.b.a(SourceFile:174)
at com.esri.arcgisruntime.internal.a.b.a(SourceFile:46)
at com.esri.arcgisruntime.internal.a.b$1.a(SourceFile:53)
at com.esri.arcgisruntime.internal.jni.CoreTask.onTaskCompleted(SourceFile:144)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant