zackster
09/16/2022, 4:19 PMgsr
09/16/2022, 6:57 PM<cfset Replacelist(Errormsg,'3,4,5,6,7,8,9,11,12,13,14,15,16,17,18','1,2,3,4,5,6,7,8,9,10,11,12,13,14,15')>
gsr
09/16/2022, 7:09 PMAdam Cameron
To see details for this component you need to enable debug output
Two things:
1. why?
2. Um... if that means the debug settings in admin (/lucee/admin/server.cfm?action=debugging.settings
and/or /lucee/admin/web.cfm?action=debugging.settings
)... then... erm... they are all switched on. Does it mean something else?Adam Cameron
Anders Lars
09/18/2022, 12:32 AMgsr
09/18/2022, 12:55 PMMarc Funaro
09/20/2022, 8:15 PMCountries
table, we have an NCHAR(2) field for isoAlpha2 country codes (e.g., US
or DZ
or EN
, etc.). However, when I select a single country using ORM (e.g. c = EntityLoadByPK("Country", 220);
) the isoAlpha2 value comes back TRUNCATED to just a single letter (U
or D
or E
). As mentioned, I've tried the (deprecated) JDBC driver that comes with Lucee as well as the Microsoft JDBC extension. This same select / retrieval works fine in the Adobe CF version of the app that we are migrating from. I have checked all the possible datasource settings, to no avail. Any advice on troubleshooting from here would be welcome.zackster
09/23/2022, 8:58 AMzackster
09/23/2022, 9:28 AMGareth
09/23/2022, 10:00 AMzackster
09/23/2022, 10:04 AMzackster
09/23/2022, 1:59 PMzackster
09/23/2022, 4:39 PMcachedWithin="instance"
along the lines of cachedWithin="request"
for functions https://docs.lucee.org/reference/tags/function.htmlwaleedehsan1
09/26/2022, 1:51 AMzackster
09/26/2022, 10:48 AMGareth
09/26/2022, 1:08 PMmikechy
09/26/2022, 5:26 PMmikechy
09/26/2022, 5:26 PMmikechy
09/26/2022, 5:27 PMsteveduke
09/26/2022, 7:37 PMnew DatabaseReader.Builder(file).withCache(new CHMCache()).build();
Builder
is an inner class of DatabaseReader
.
I’m able to init() Builder (and subsequently the database reader API) using the $
notation as defined in the Lucee docs. However I am unable to call the Builder withCache()
method.
The API docs for build()
and withCache()
are here.
This is the code I’m running; 1st what works, and then 2nd my failing attempt at including the cache object.
1st:
This works, it creates a database using a maxmind DB file, and the database reader API:
<cfscript>
ip = '209.85.231.104';
// build the database file object
dbfile = "/pathto/geoip/lib/GeoLite2-Country.mmdb";
db = createObject("java","java.io.File").init(expandpath(dbfile));
// initiate the database reader object
reader = createObject("java", "com.maxmind.geoip2.DatabaseReader$Builder",expandpath('/pathto/geoip/lib/geoip2-3.0.1.jar')).init(db).build();
// create ipaddr class
iaddrClass=CreateObject("java", "java.net.InetAddress");
// test
address=iaddrClass.getByName(ip);
writedump(reader.country(address).getCountry().getName());
writedump(reader.country(address).getCountry().getIsoCode());
</cfscript>
2nd:
This doesn't work, I create the cache object and attempt to call it on the builder object with .withCache(maxMind_CHMCaching)
and returns the following error:
No matching Method/Function for com.maxmind.geoip2.DatabaseReader$Builder.withCache(com.maxmind.db.CHMCache) found
<cfscript>
ip = '209.85.231.104';
// build the database object
dbfile = "/pathto/geoip/lib/GeoLite2-Country.mmdb";
db = createObject("java","java.io.File").init(expandpath(dbfile));
// initiate a maxmind caching object
maxMind_CHMCaching = createObject("java", "com.maxmind.db.CHMCache",expandpath('/pathto/geoip/lib/maxmind-db-2.0.0.jar')).init();
// initiate the database reader object using cache
reader = createObject("java", "com.maxmind.geoip2.DatabaseReader$Builder",expandpath('/pathto/geoip/lib/geoip2-3.0.1.jar')).init(db).withCache(maxMind_CHMCaching).build();
// create ipaddr class
iaddrClass=CreateObject("java", "java.net.InetAddress");
// test
address=iaddrClass.getByName(ip);
writedump(reader.country(address).getCountry().getName());
writedump(reader.country(address).getCountry().getIsoCode());
</cfscript>
If anyone has an idea of what I should try next I would appreciate the feedback.zackster
09/27/2022, 11:27 AMa = [].set(1, 10000, "zac");
c = 0;
timer type="outline" {
loop array=a index="b" {
c++;
}
}
dump(c);
d = 0;
timer type="outline" {
a.each(function(e){
d++;
});
}
dump(d);
f = 0;
timer type="outline" {
a.each(function(g){
f++;
}, true);
}
dump(f);
alexpixl8
09/27/2022, 11:44 AMSlackbot
09/27/2022, 1:39 PMzackster
09/28/2022, 10:29 AMSimone
09/29/2022, 12:27 AMSebastiaan Naafs - van Dijk
09/29/2022, 10:47 AMileslie
09/29/2022, 8:51 PMgsr
09/29/2022, 11:47 PMgsr
09/29/2022, 11:47 PM