I have upgraded my application to Java 11. When trying to connect to MSAccess DB, getting below error: ERROR com.web.core.ExceptionResolver - Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.healthmarketscience.jackcess.impl.query.QueryFormat [com.greytip.cougar.asca.web.core.ExceptionResolver getModelAndView 83] org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError:...
Hi Gord, Is the mentioned formats are implemented in the latest version? Please let me know the status on the different unique date formatting implementation.
I am unable to modify hsqldb code where some objects refering hsqldb persist cache and RowAVLDisk.
I am unable to modify hsqldb code hence sharing you aquired dump after modifying memorytimer object code in DBReference.
Thank you Gord. I was analyzing heap dump from Memory Analyzer Tool and found some suspects which are causing issues. 1) Suspect1:: One instance of "org.hsqldb.persist.DataFileCache" loaded by "sun.misc.Launcher$AppClassLoader @ 0xc001f180" occupies 8,377,472 (14.34%) bytes. The memory is accumulated in one instance of "java.lang.Object[]" loaded by "<system class="" loader="">".</system> Keywords sun.misc.Launcher$AppClassLoader @ 0xc001f180 java.lang.Object[] org.hsqldb.persist.DataFileCache 2)...
I am getting "java.lang.OutOfMemoryError: Java heap space" error.
No Gord.. OLE object (BLOB) column cases are very rare and we didnt find any issues in that case. Column formats are (Short text, int, datetime)
No Gord.. OLE object (BLOB) column cases are very rare and we didnt find any issues in that case. Column formats are (String, int, datetime)
Awaiting for your response...
Gord, Any updates on this? I am facing this issue quite often every alternative day. It works normal for 1 or 2 days once I restart my application service, but again issue occurs. Memory is not releasing once hsqldb is created. Every 30 seconds I am querying my DB from application through ucanaccess to fetch records and process them. Each and every time I run, memory increases by 5 to 10MB. By end of the day memory would increase 900MB to 1GB.
Gord, Any updates on this? I am facing this issue quite often every alternative day. It works normal for 1 or 2 days once I restart my application service, but again issue occurs. Memory is not releasing once hsqldb is created.
I've one suggestion for nect release. Reduce row count "DEFAULT_STEP" in LoadJet class while inserting records into hsqldb. Currently you are loading 2000 rows in a batch. Which may cause memory issue if columns are more. Reducing it would solve memory issue for some extent.
I am getting memory issue while selecting records. As per your suggestion, I have created linked database for required tables. Case1: There are 20Lakh+ records and 6 columns in a table. "Memory=false;preventreloading=true;immediatelyReleaseResources=true;" connection parameters is working fine with this case. Even for 40Lakh+ records, I am not facing any issue. Case2: 1Lakh and less than 1Lakh records and 20 to 30 columns in a table. "Memory=false;preventreloading=true;" immediatelyReleaseResources=true;...
I am getting memory issue while selecting records. As per your suggestion, I have created linked database for required tables. Case1: There are 20Lakh+ records and 6 columns in a table. "Memory=false;preventreloading=true;immediatelyReleaseResources=true;" connection parameters is working fine with this case. Even for 40Lakh+ records, I am not facing any issue. Case2: 1Lakh and less than 1Lakh records and 20 to 30 columns in a table. "Memory=false;preventreloading=true;" immediatelyReleaseResources=true;...
I am using UNION query like below. Select order.name, order.id, order.purchaseDate from tblorderdetails order UNION Select sale.name, sale.id, sale.saleDate from tblorderdetails sale Also, BaseSelectQuery.getFromTables() method cannot be referenced directly as it is non-static method.
I am using UNION query like below. Select order.name, order.id, order.purchaseDate from tblorderdetails order UNION Select sale.name, sale.id, sale.saleDate from tblorderdetails sale
Yeah.. It is 97 format mdb.
Most of the columns in the table have same limit and all the columns have same issue. I cannot increase limit as it throwing error of database size issue.
Can we decrease row count while inserting records from MDB to hsqldb. As the resultset loading 2000 rows at a time as batch and insert into hsqldb. This is taking huge memory. Even though it will de-allocate once process is completed, till reading and inserting 2000 rows memory will be consumed. Also, are you updating hsqldb version in ucanaccess?
Anu updates Gord?
I am loading data from MDB to process records. As UCANACCESS load those records into hsqldb before loading records into resultset, i'm getting "UCAExc:::4.0.4.1 data exception: string data, right truncation" error. My column type is text and length is fixed to 4. Also, my column values didn't cross the limit as it will not allow more than that and values are exact 4 characters. But, i am unable to understand, why i m getting data truncation error.
I came through this point in your blog UCanAccess does support multiple concurrent processes where: all processes read the database but do not write to it, or only one process writes to the database while all other processes just read it. My case falls under second point. Database which I am accessing is written by only one process. I am just reading the database. No write operation performed by me or any other process except MS Acess ODBC. Even in connection I'm getting it as Readonly=true
can we use preventreloading in such case?
Are u implementing these date formats to read date and time from text columns?
Yes Gord, it is multi connected database. Other than my Java application, one more prrocess will be using that database.
Hey Gord, Any updates on this? Is there anything to be handled from my end for this.. I added metrics and checked that JVM is consuming 100MB before getting connection. But, once connection done and select query executed, memory consumption is 1GB to 1.5GB
Hey Gord, Any updates on this?
java.sql.SQLSyntaxErrorException: user lacks privilege or object not found java.lang.OutOfMemoryError: Java heap space net.ucanaccess.converters.Functions in statement [CREATE FUNCTION PV(par0 DOUBLE,par1 DOUBLE,par2 DOUBLE,par3 DOUBLE,par4 DOUBLE) RETURNS DOUBLE LANGUAGE JAVA DETERMINISTIC NO SQL EXTERNAL NAME 'CLASSPATH:net.ucanaccess.converters.Functions.pv'] [uk.org.lidalia.sysoutslf4j.context.LogLevel$5 log 84] I found one more issue.
I also noticed that table's row count in the metadata is 500227 but 500500 records have been found and loaded by UCanAccess. All will work fine, but it's better to repair your database. [uk.org.lidalia.sysoutslf4j.context.LogLevel$5 log 84] quite often in logs. Is there any impact on loading my records due to this error as I don't want to repair client database. Also, this is due to continuous record insertion to DB when loading data from driver.
I also noticed that table's row count in the metadata is 500227 but 500500 records have been found and loaded by UCanAccess. All will work fine, but it's better to repair your database. [uk.org.lidalia.sysoutslf4j.context.LogLevel$5 log 84] quite often in logs. Is there any impact on loading my records due to this error?
When i load records from one of the table in my access database, sometimes it is working smoothly without any issues. But, some time i get Java heap space error as below. java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.util.Arrays.copyOf(Unknown Source) at java.util.ArrayList.grow(Unknown Source) at java.util.ArrayList.ensureExplicitCapacity(Unknown Source) at java.util.ArrayList.ensureCapacityInternal(Unknown Source) at java.util.ArrayList.add(Unknown...
Hi Gord, Please update below date formats in RegionalSettings.java file to support datetime format from text columns. Thank you for your supprt. addDateP("yyyy-MM-dd H.m", true, false); addDateP("yyyy-MM-dd h.m.s a", true, false); addDateP("yyyy-MM-dd H.m.s", true, false); addDateP("yyyy-MM-dd h:m:s a", true, false); addDateP("yyyy-MM-dd H:m:s", true, false); addDateP("yyyy-MM-dd H:m", true, false); addDateP("yyyy-MM-dd", true, false); addDateP("yyyy/MM/dd H.m", true, false); addDateP("yyyy/MM/dd...
Gord, sorry for troubling you a lot. One more help where i guess I complete half of my way. Can we create view from executestatement.
I am working with large mdb database to fetch records to my Java code to process them. Due to large size of the mdb, it is taking more time for connection from UCanaccess driver. As per Gord suggestion we are creating linked database from the code he shared. We are providing option to select table to be load, so that table can be copied to linked database. But, if there is a view/Query to fetch records, we have to move all dependent tables to linked database. I tried SysObjJoin on "MSysQueries" and...
Thank you James.. Is there any way to find out dependency tables of the MS Access saved query?
is there any way to check dependency tables on which Query is created. E.g: Select order.name, order.orderdatetime from order I'm creating linked database with required tables where in UI i can give only query which is required to fetch details. But, i cannot add Query in to linked database from code. So, how can i add query and its dependency tables to linked database.
is there any way to check dependency tables on which Query is created. E.g: Select order.name, order.orderdatetime from order I'm creating linked database with required tables where in UI i can give only query which is required to fetch details. But, i cannot just add Query in linked database. So, how can i get dependency tables to linked database.
Hi James, I have a query regarding getTableNames() method. I can load all the table names with this method. But, what if I want to load only tables with some patterns (dynamic tables) e.g: Test_2_2019, Test_1_2019.
But, from where can i get Table name as it is dynamic tables. Main concern here is, There are 'N' number of clients sharing there Access DB with us. All clients have different vendors who maintains different formats. I cannot assume table name till i get interaction with client and it will be terrific to change table name for each and every client. So please let me know any other solution to handle memory.
Gord, We have modified regionalsettings class with guidance. But, these changes will be lost if we update newer version of driver. Can we share you the class so that you can imcorporate changes in next release?
Gord, I accept this solution to work in local environment. But, we are working on client databases where we will not get permission to do such things.
Whenever we connect to mdb through UCanAccess, it will load all the tables which is causing performace issue. Is there any way to restrict loading all the tables. Instead we can provide table or view to be loaded. I'm using memory=false;skipIndexes=true; in my connection URL.
Whenever we connect to mdb through UCanAccess, it will load all the tables which is causing performace issue. Is there any way to restrict loading all the tables. Instead we can provide table or view to be loaded.
Driver will not support appending with "+". There is not time functions supported to fetch timevalue and append. :(
We are facing some issues related to datetime format with cDate. We cannot append date and time column if both the columns are of datetime format. What i found while working is, UCanAccess driver is not fetching data from view directly. It is loading table content from backend and fetching its format then executing query. Am i right?
Thanks for that. But, i have one query with one of the format. If you check the file i have shared at the end, odate is the column have date and column type is datetime. otime is the column have time and column type is text. Whats the Format i need to update for this case? Also, please let me know, whats the boolean parameters you are passing with dates?
Here is the attachment with addition of few more formats. I have added 3 more columns where 1) Date- column can be text or date/time 2) Time- text column Appending date and time using cDate as "cDate(date &" "& time). I was going through regionalsettings class and found we need to update all the valid date and time formats in that.
Thanks Gord.. It is working fine with only the format which I've shared "dd-MMM-yyyy HH:mm:ss". But, it is not supporting any other formats. I had mentioned you that my String column don't have any particular format. I have added some sample rows in mdb file with different datetime format. Whatever the valid format in String column is, cDate(column) will convert to datetime in Access. Same way driver should support all valid formats. If you can guide class to be modifed, even we will try.
Thanks for your support Gord. Do we need to wait for next release for this to resolve or we get any patch for this and by when can we expect the patch/release? It would be great if we get patch soon as I'm stucked due to this.
Thanks for your support Gord. Do we need to wait for next release for this to resolve or we get any patch for this and by when can we expect the patch/release?
Thanks for your support Gord. Do we need to wait for next release for this to resolve or we get any patch for this?
As it is text type, i cannot assume the format. That is why I am converting to datetime using cDate as the function will convert any format to datetime. My current format of the String value is "dd-MMM-yyyy HH:mm:ss". But, it is not fixed format. Attaching database file with this.
As it is text type, i cannot assume the format. That is why I am converting to datetime using cDate as the function will convert any format to datetime. My current format of the String value is dd-MMM-yyyy HH:mm:ss Attaching database file with this.
Here is my code: public static void main(String[] args) throws SQLException { File file = new File("E:\att_data\Testing.accdb"); Connection conn = DriverManager.getConnection("jdbc:ucanaccess://" + file.getAbsolutePath()); String sql = "SELECT * from vieworderdetails"; test(conn, sql); } private static void test(Connection conn, String sql) throws SQLException { Statement stmt = null; ResultSet rs = null; try { stmt = conn.createStatement(); rs = stmt.executeQuery(sql); while (rs.next()) { System.out.println("ID:...
Here is my code: public static void main(String[] args) throws SQLException { File file = new File("E:\att_data\Testing.accdb"); Connection conn = DriverManager.getConnection("jdbc:ucanaccess://" + file.getAbsolutePath()); String sql = "SELECT * from vieworderdetails"; test(conn, sql); } private static void test(Connection conn, String sql) throws SQLException { Statement stmt = null; ResultSet rs = null; try { stmt = conn.createStatement(); rs = stmt.executeQuery(sql); while (rs.next()) { System.out.println("ID:...
Here is my code: public static void main(String[] args) throws SQLException { File file = new File("E:\att_data\Testing.accdb"); Connection conn = DriverManager.getConnection("jdbc:ucanaccess://" + file.getAbsolutePath()); String sql = "SELECT * from vieworderdetails"; test(conn, sql); } private static void test(Connection conn, String sql) throws SQLException { Statement stmt = null; ResultSet rs = null; try { stmt = conn.createStatement(); rs = stmt.executeQuery(sql); while (rs.next()) { System.out.println("ID:...
Here is my code: public static void main(String[] args) throws SQLException { File file = new File("E:\att_data\Testing.accdb"); Connection conn = DriverManager.getConnection("jdbc:ucanaccess://" + file.getAbsolutePath()); String sql = "SELECT * from vieworderdetails"; test(conn, sql); } private static void test(Connection conn, String sql) throws SQLException { Statement stmt = null; ResultSet rs = null; try { stmt = conn.createStatement(); rs = stmt.executeQuery(sql); while (rs.next()) { System.out.println("ID:...
This is the view Select id, cDate(orderdatetime) as orderdate, ordername from order;
I have a simple code to fetch records from my mdb file having coulmns (id,orderdatetime,ordername) where id is int and remaining columns are text. I am creating one view as "select id, cDate(orderdatetime),ordername from tblorderdetails". Able to get data from view, but orderdatetime field is showing only date. Time part is blank. Input date: 2019-01-30 15:40:00.0 Output date: 2019-01-30 00:00:00.0 Same was working in ODBC driver. But, i am upgrading Java to 8 so please help me on this.