Has anyone managed to get the Mach-II framework wo...
# cfml-general
g
Has anyone managed to get the Mach-II framework working when storing sessions in a database (MariaDB/MySQL)? I am using Lucee 5.4.latest and I have tried Mach-ii 1.8 / 1.81 and 1.9 Initially I get a bigInteger casting issue, which I have fixed with a one liner... but sessions just do not work correctly. I kept getting Mach-ii messages about the session not being active / not defined and I have to login, again. If I do NOT use a DB for session storage - the application works fine.
s
I'm a bit surprised Mach-II still works at all on recent versions of Lucee (and Adobe?), given that it was officially sunsetted 11 years ago... That's kind of impressive. I'll bet it was never tested with sessions in a database -- was that even a thing over a decade ago? You're probably on your own in terms of just debugging and patching your local copy of Mach-II at this point...
r
Wow, I worked with MachII in ... 2003 I guess. Author name was Hal Helms if I'm not wrong.
Gavin, I think the error has nothing with MachII, it's about pulling session data from database and converting it, I bet it not happens in the framework. Maybe JDBC driver mess up values of BigInteger or database has wrong column type
g
Hi @rodyon The bigInteger issue was definitely a coding bug in the framework. But it is very likely that ACF and Lucee were more generous with their dynamic typing than they are now. I have fixed the initial issue I was having - and it "kinda" works. The latest problems are: On initial login - you are redirected to the login page - as if you have not successfully logged in - but if you to any other URL - (without logging in again) you are fine - you ARE logged in and have a valid session. Also if a user "impersonates" another user - it is effectively a "login: process again... - the sessions is lost and you have to log in again. There are numerous posts on here about using db storage for sessions and how they have it working... those "working" posts are NOT using Mach-II, though. I am very happy to be proven wrong - but I am all-but otherwise convinced, that it is Mach-II that is the issue in our case.
g
I suppose you are using
sessionstorage="dbsource"
?
r
I went full-nostalgic and downloaded MachII version 1.9, tried to run skeleton app, which immediately stuck at parsing xml (Lucee 6 didn't like <DOCTYPE>)
removed doctype, turned session storage to a Datasource, Lucee created a table and saved something there
image.png
image.png
Coldspring isn't a thing anymore, and this MachII is not the one I used in 2003 🙂
g
There is data being saved into my DB, too. That isn't my problem. It is possible that it is our code and the way we are using mach-ii... but let me repeat the only difference we have made is to use a db for session storage, instead of ram. and all the exceptions are being thrown by Mach-ii code. It is as if session storage and retrieval at the amch ii level is faulty when using a db. Nonetheless, we are continuing to investigate... despite this being the second week of working on it full-time. Thus I reached out for help, here - hoping we were not the only ones still using it.
r
Sorry for it, machII is really rare and old thing, even Fusebox apps are still around, but not machII.
s
hoping we were not the only ones still using it
I was a heavy user and contributor to Mach-II -- we built large Mach-II apps at Macromedia -- but with that huge XML file, it dropped out of favor, especially once ColdBox and FW/1 appeared. I think even Model-Glue was more widely used than Mach-II...
g
I do love the simplicity of fusebox!
s
Fusebox 3? Fusebox 4+? Fusebox 5+ with CFCs instead of XML? 😄
(even at Macromedia, we stopped building apps with Mach-II and switched to Model-Glue for new apps)
r
Gavin, just last note, I believe MachII is just working on top of Lucee, and it's Lucee who manages session serialization to DB. MachII is just a CFML code working on different level of abstraction than Lucee (java app). Maybe your application doing some manual session decoding stuff, I don't know. BigInteger you mentioned sounds something from Java, not CFML. But... I'd check if J2EE sessions are NOT used, since DB type of session support only application sessions then I'd go updating Java version, tinkering-updating JDBC driver, checking if MySQL version is not obsolete.... In other words, I'd go one level lower than MachII to investigate this. Hope you find your solution ✌🏼
g
Hi @rodyon Thanks for your thoughts... The Mach-II code specifically uses javacast and creates bigDecimal values. (off the top of my head) ... The bigDecimal issue was
xxx.compareTo(yyy)
was used. Where xxx was not a
Double
and yyy was a
bigInteger.
I changed it to be math equation xxx-yyy - instead of using the Java classes built in compareTo method. As for the session type settings - they (to the best of my knowledge) correct. A dump confirms we are NOT using jee sessions.
@seancorfield I started with FB3 and then moved along up to FB5. I really like it, a lot. And as much as one can do - became really good (online) friends with Hal and Jeff Peters. I find myself still recommending Jeff's books on occasion!
s
Roddy's point about JDBC driver version is a good one: MySQL in particular has repeatedly changed how certain types are serialized/deserialized over different driver versions 😞 Hal and Jeff are interesting characters. I enjoyed working with them on both Mach-II and Fusebox over the years, and I loved their podcast!
👍🏼 1
g
The podcasts were awesome - especially when you're young / starting out - a lot of content about working in general - as opposed to CFML technical talks... though there were plenty of them, too! "Helms and Peters Out Loud" At one stage I downloaded every single one from iTunes!