-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Late and safer response writes #605
base: master
Are you sure you want to change the base?
Conversation
It addresses the following issue: garcia-jj/vraptor-plugin-hibernate4#18
I don't know if the request execution is the right place to put this code. Maybe creating another interceptor for this would be better. as the first interceptor, with the code running after the stack.next(..) call. |
I wasn't sure about execution order guarantees, but you are right, probably no one is going to deal with the response before |
The code makes sense, but it could break existing applications... we should be careful testing with existing applications before shipping this. And also write some tests for the feature ;) |
I can't understand why this is necessary. |
if we write anything to response, it will commit the response, so the status code can't change. If any error occurs after the It happens, for example, on the transaction interceptor, which commits the transaction after the controller execution. |
@garcia-jj serializers write directly to response stream. |
@lucascs Regarding the shipping of this code, in a first release we might glue it to gson (or any other) serialization. If everything goes fine then we handle other serializers. |
Hmm, now I see. I'm worried about performance, because we will store many data into memory as json/xml is too long. Ideas? |
If we ship we should do it on all serializers. |
just realized a second approach for the issue would be deprecating There is also a third approach - recommending users of the serializers to adjust the response buffer size of the servlet container to a value that fits their response payloads. This can even be made programatically and it actually solves the problem. |
I don't know if this is actually possible, but, instead of caching the Chico Sokol On Thu, Mar 6, 2014 at 7:01 AM, rafanoronha [email protected]:
|
If we go with the csokol solution, we could add a what do you think? |
Yeah sounds like the better approach so far. I'll try to give it a shot |
Not intended to be merged - just a preview to support further discussion.
This shows how feasible might be my way to address this[1] issue in vraptor core.
Does this piece of code make sense around here?
[1] garcia-jj/vraptor-plugin-hibernate4#18