[uportal-dev] Paradigm advice on working with hibernate in Simple Content Portlet

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[uportal-dev] Paradigm advice on working with hibernate in Simple Content Portlet

Toby Archer
A while back I made an attachments manager for the Simple Content Portlet to allow our marketing staff to upload arbitrary files to the portal and receive a link to them. It had some minor flaws, like not knowing how many attachments there were in total and so not knowing how to paginate properly, but it worked well enough. Recently though we've run into another flaw of the portlet as I've designed it: It loads all the attachments at once. This wasn't an issue when the number of attachments was small, but now we have passed 2500 attachments and that means loading this portlet requires loading 3+gb of data from the database and then promptly dumping it. 

This is where I need some advice, I've always said Java isn't my first language and Hibernate is particularly so not my style of programming. If I was doing this manually by requesting the row from SQL I would just leave off the bdata column and only load the metadata. But just leaving off one column does not seem to be a straight forward concept in Hibernate. Before I hack something together I figured I'd ask people a little more in tune with this style of programming, what is the recommended way of achieving this? 

~TA

--
You received this message because you are subscribed to the Google Groups "uPortal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/uportal-dev/c361abf4-b2be-4e72-be64-c003850f7546%40apereo.org.