| |

VerySource

 Forgot password?
 Register
Search
Author: blankness0

Ask a question about session, prawns help!

[Copy link]

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-21 13:15:01
| Show all posts
I have a solution, but I don’t know if the efficiency is high! !
You put all your Arraylists into one Arraylist, just don’t use one Arraylist for one table, just one Arraylist for all tables! This becomes a session. If you want to get the value, you can get it out as an array. The example is not easy to write, and it is available in the Hibernate book. I just give an opinion! !
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-7-24 20:00:01
| Show all posts
You put all your Arraylists into one Arraylist, just don’t use one Arraylist for one table, just one Arraylist for all tables! This becomes a session??????
what does this mean? Can you elaborate? Because I originally put these ArrayLists in a session, what is the difference between doing this and before? Can you solve the problem of code confusion?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Sweden

Post time: 2020-7-26 18:45:01
| Show all posts
The amount of data like this is better not to be placed in the session. Write a file for access. The session is prone to errors
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 United States

Post time: 2020-7-31 16:45:01
| Show all posts
What I said may be incorrect, I just hope you try.
I think you have attached too many ID values ​​to the session above, which is not good! Is to change all Arraylists into one,
/**
This becomes a session??????
*/
This sentence is wrong, you originally used the same session, session.setAttribute (ID, key) is the relationship, I don't know if you can solve the above problem, but I think it is better than the method you used, and The code also looks concise and easy to maintain; the person above said that it is not feasible to read files, and many exceptions are prone to occur, mainly because of slowness.
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-31 19:00:01
| Show all posts
I think it should be written in a file, set up a mapping (.xml configuration file), then store the mapped key value in the session, and read the data through the configuration file. This should be better.
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-31 21:30:01
| Show all posts
It takes time to read a file, first store the file, then read the file, think about it! ! ! . . . If you use .XML files for storage, you still have to parse it. I think if you really can’t think of a way to use this method again, this is the most complicated way.
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-1 12:15:01
| Show all posts
What should I do! ?
In a similar situation, how did the masters solve it? ? ? Talk about ideas! !
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-2 11:30:01
| Show all posts
Your problem may be related to threads. Provide an idea, you can write a component yourself, the role is not in the scope of the session, but in the scope of the request. This can avoid this problem.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-2 13:30:01
| Show all posts
There are many overlapping sessions. In-depth research can be compared with cokkie.
It is recommended to empty it before storing the session!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list